You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Bertrand Delacretaz <bd...@apache.org> on 2016/08/08 11:06:22 UTC

How to fail fast on Java 1.7 ?

Hi,

As org.apache.felix.http.jetty now requires Java 1.8, trying to start
the launchpad/builder jar with 1.7 fails to bring up an HTTP port.

Although the standard missing requirements message is logged [1], I'd
like to implement a louder failure in this case - the launchpad should
exit quickly with a blatant error message explaining that it cannot
run on 1.7 or less anymore.

Do people have suggestions for how to implement this cleanly, for all launchers?

Being able to set the equivalent of
Bundle-RequiredExecutionEnvironment at the framework level would be
nice but I don't think it's possible.

-Bertrand

[1]  Unable to resolve org.apache.felix.http.jetty [33](R 33.0):
missing requirement   [org.apache.felix.http.jetty [33](R 33.0)]
osgi.ee; (&(osgi.ee=JavaSE)(version=1.8))

Re: How to fail fast on Java 1.7 ?

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Mon, Aug 8, 2016 at 1:17 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> Why not simply compile launchpad base with Java 8? ...

Good idea - it won't work for other launchers but that's a good first step.

Implemented in SLING-5951.

-Bertrand

Re: How to fail fast on Java 1.7 ?

Posted by Carsten Ziegeler <cz...@apache.org>.
Why not simply compile launchpad base with Java 8?

Carsten

> Hi,
> 
> As org.apache.felix.http.jetty now requires Java 1.8, trying to start
> the launchpad/builder jar with 1.7 fails to bring up an HTTP port.
> 
> Although the standard missing requirements message is logged [1], I'd
> like to implement a louder failure in this case - the launchpad should
> exit quickly with a blatant error message explaining that it cannot
> run on 1.7 or less anymore.
> 
> Do people have suggestions for how to implement this cleanly, for all launchers?
> 
> Being able to set the equivalent of
> Bundle-RequiredExecutionEnvironment at the framework level would be
> nice but I don't think it's possible.
> 
> -Bertrand
> 
> [1]  Unable to resolve org.apache.felix.http.jetty [33](R 33.0):
> missing requirement   [org.apache.felix.http.jetty [33](R 33.0)]
> osgi.ee; (&(osgi.ee=JavaSE)(version=1.8))
> 


 

-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org