-
Bug
-
Resolution: Fixed
-
P3
-
9, 21, 22, 23
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8324367 | 22.0.1 | Mandy Chung | P3 | Resolved | Fixed | b02 |
JDK-8323371 | 22 | Mandy Chung | P3 | Resolved | Fixed | b31 |
JDK-8336067 | 21.0.6-oracle | Weibing Xiao | P3 | Resolved | Fixed | b02 |
JDK-8336066 | 17.0.14-oracle | Weibing Xiao | P3 | Resolved | Fixed | b03 |
JDK-8336064 | 11.0.26-oracle | Weibing Xiao | P3 | Resolved | Fixed | b03 |
I have a java-project that is build as module. The name of the module starts with "com" (e.g. com.project). This module has a dependency to jdk.httpserver. When I run the compiled jar with java command, then everything works fine. But when I build a runtime image with jlink and try to start that one, I get an error ("Module com.project not in boot Layer").
If I change the module name to not start with "com" (e.g. org.project) or remove the dependency to jdk.httpserver or use Java 17, then the runtime image created by jlink works fine.
REGRESSION : Last worked in version 17.0.9
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a java project with a starter class (com.project.Starter) containing the main method.
Add module-info.java and name your project "com.project" and add dependency to "jdk.httpserver".
Compile the project.
Use jlink to build a runtime image:
jlink --module-path "c:\<path-to-jdk>\jmods;out" --add-modules com.project --launcher starter=com.project/com.project.Starter --output image
Execute image/bin/starter.bat and you will get an exception: "Module com.project not in boot Layer"
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Running application (no exception)
ACTUAL -
java.lang.InternalError: Module com.project not in boot Layer
---------- BEGIN SOURCE ----------
##Starter##
package com.project;
public class Starter {
public static void main(String[] args) {
System.out.println("Hello world");
}
}
##module-info.java##
module com.project {
requires jdk.httpserver;
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
renaming module to not start with "com"
FREQUENCY : always
- backported by
-
JDK-8323371 SystemModulesMap::classNames and moduleNames arrays do not match the order
- Resolved
-
JDK-8324367 SystemModulesMap::classNames and moduleNames arrays do not match the order
- Resolved
-
JDK-8336064 SystemModulesMap::classNames and moduleNames arrays do not match the order
- Resolved
-
JDK-8336066 SystemModulesMap::classNames and moduleNames arrays do not match the order
- Resolved
-
JDK-8336067 SystemModulesMap::classNames and moduleNames arrays do not match the order
- Resolved
- relates to
-
JDK-8323547 tools/jlink/plugins/SystemModuleDescriptors/ModuleMainClassTest.java fails to compile
- Closed
- links to
-
Commit openjdk/jdk22/71cc879b
-
Commit openjdk/jdk/f3be138e
-
Review openjdk/jdk22/46
-
Review openjdk/jdk/17316