Comments below:

On 04/06/2016 12:34 PM, Alan Bateman wrote:
On 06/04/2016 11:17, Richard Opalka wrote:
Hi Experts,

I expected if users provide 'multirelease' jar file with modules-info.class
placed in its META-INF/versions/9 folder would work without problems.
But I'm getting:

Caused by: java.lang.IllegalArgumentException: META-INF.versions.9: Invalid package name: Illegal character at index 4

instead. Does it mean JEP-238 and JEP-261 cannot coexist?
There isn't any support yet for modular JAR as multi-release JARs. It's tracked as JDK-8146486 with the main question being whether the compiled module declaration can be in the META-INF/versions tree or not.

As things stand then a JAR file that does not have a module-info.class in the top level directory is assumed to be an automatic module so this is why it barps when trying to determine a package name from META-INF/versions/9.
IMHO it should be allowed to put module-info.class to META-INF/versions
subtree as modules may evolve (their imports/exports) with different JDK versions. // My 2c.

BTW: Just looking at the contents of your JAR file then it looks like this is the EE version of the Common Annotations. In that case you shouldn't need a multi-release JAR. Instead you should be able to put the module-info.class in the top level directory and deploy it on the upgrade module path.
Yes I know. Our requirement is to support both JDK8 and JDK9 with the same jar. Thus in my experiments I have javax classes compiled for JDK8 and module-info.class for JDK9. Multi-Release jar was my first attempt, when it failed I did what you propose above Alan.

-Alan
Rio

Reply via email to