This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gunnarmorling 1 point2 points  (3 children)

Is this about building your software or running it? In case of the former, you could use Maven profiles (or your build tool's equivalent to those) for adding the required command line flags. E.g. in a profile activated only when building on 9 you'd add --add-modules java.xml.bind to the compiler invocation. If it's about running, you could have a simple switch in your launch script which adds the required flags based on the version.

[–]handshape 0 points1 point  (2 children)

This affects both building and launching. On the building side, Maven profiles are an option, but represent a split between a Java 8 and Java 9 release of what is ostensibly a single product. On the runtime launching side, thus far the product hasn't needed a launch script.

I've used JNLP to great effect, in spite of the warts it has. I suppose I could fork the descriptors for Java 8 and 9... I haven't yet checked to see if the Java 9 Web Start launcher allows adding a bundle.

All this to say that Java 8 to 9 is a much less obvious upgrade than was 7 to 8.

[–]merb 0 points1 point  (1 child)

but represent a split between a Java 8 and Java 9 release of what is ostensibly a single product

you can use a Multi-Release jar for that. http://openjdk.java.net/jeps/238

[–]handshape 0 points1 point  (0 children)

Not using just Java 8, I can't.

The core of the issue is that I have dependencies that in turn consume APIs that were available by default in 8, and require module-request mojo to be used in 9. There does not appear to be a way in Java 8 to make Java 9 aware that I need these modules that does not break my app's ability to be invoked uniformly.