jlink / jmods version compatibiltiy
Hello, I am not sure what the Policy for backward/Forward compatibility for JMOD files is, but when I use JDK-9.0.4 jlink on 11ea JMODs I get a IllegalArgumentException and „error reading“ by JDK-10.0.1 with no further Details. If the JMOD files require newer jlink, should they have a Version identifier to allow rejecting this. Or is it expected to normally work? C:\ >"c:\Program Files\Java\jdk-9.0.4\bin\jlink" --verbose --module-path "jdk-11-oraopenjdk\jmods" --output o1 --add-modules=java.base,jdk.crypto.mscapi,jdk.jartool,jdk.jcmd,jdk.jshell,jdk.naming.dns --strip-debug --compress 2 --no-header-files … Error: java.lang.IllegalArgumentException C:\>"c:\Program Files\Java\jdk-10.0.1\bin\jlink" --verbose --module-path "jdk-11-oraopenjdk\jmods" --output o2 --add-modules=java.base,jdk.crypto.mscapi,jdk.jartool,jdk.jcmd,jdk.jshell,jdk.naming.dns --strip-debug --compress 2 --no-header-files Error: Error reading module: jdk-11-oraopenjdk\jmods\java.base.jmod C:\>"c:\Program Files\Java\jdk-11\bin\jlink" --verbose --module-path "jdk-11-oraopenjdk\jmods" --output o3 --add-modules=java.base,jdk.crypto.mscapi,jdk.jartool,jdk.jcmd,jdk.jshell,jdk.naming.dns --strip-debug --compress 2 --no-header-files … Providers: … Gruss Bernd -- http://bernd.eckenfels.net
On 6/1/18 3:24 PM, Bernd Eckenfels wrote:
Hello,
I am not sure what the Policy for backward/Forward compatibility for JMOD files is, but when I use JDK-9.0.4 jlink on 11ea JMODs I get a IllegalArgumentException and „error reading“ by JDK-10.0.1 with no further Details.
jlink only supports linking modules of the same runtime version as jlink because jlink has a few plugins such as system-modules and generate-jli-classes that are deeply tied with java.base. It can be enhanced in the future in particular for plugins to support version <= jlink version. See JDK-8185130 that was integrated in JDK 10. jlink linking with older version of JMODS outputs a clear error message: $ jdk11/bin/jlink --module-path jdk10/jmods --output test-image --add-modules java.base Error: jlink version 11.0 does not match target java.base version 10.0
If the JMOD files require newer jlink, should they have a Version identifier to allow rejecting this. Or is it expected to normally work? : Error reading module: jdk-11-oraopenjdk\jmods\java.base.jmod
JDK 10 jlink does not support class file version 55 when linking with JDK 11 modules. I agree the error message should be improved. I created https://bugs.openjdk.java.net/browse/JDK-8204256. Mandy
participants (2)
-
Bernd Eckenfels
-
mandy chung