Compatibility of Java 8 libraries with Java 9

Volker Berlin volker.berlin at goebel-clan.de
Wed Apr 26 19:18:03 UTC 2017


Hi,

After reading many of migrate to Java 9 it look like that you expect 
that the people switch 100% to Java 9. I think this is wrong. Like with 
older Java versions it must be possible to run a library/application 
with Java 9, 8, ...

One command line in a script must be run with any Java VM in the 
supported version range. If this will not be valid then Java 9 will be 
dead birth.

All the new command line parameter of Java 9 does not work with Java 8. 
That there is no way to use any of this parameters until Java 9 is 
installed on a wide range of systems as runtime.

That also with Java 9 a typical application will be start with:

java -jar foo.jar


If I start an application with this classic command line then any module 
info in the jar file is ignored. I have test it today. Is this correct? 
A hello world application will work. But a more complex application will 
fail.

For example if the application use JavaMail API. The application need 
the extra modul java.activation. Now I need to add some of the new 
command line parameters. But then it work not with Java 8.


I think we need a compatible way that can work with Java 7 to Java 9. 
Extra information, for example in the manifest.mf, that will be ignored 
in older Java versions. Of course the extra information can also be 
added via module-info.class. But then the call via -jar syntax should be 
read it.


The same is valid for JNLP.


Volker




More information about the jpms-spec-observers mailing list