Details
-
Bug
-
Resolution: Fixed
-
P4
-
8
-
None
-
b06
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8045078 | 8u25 | Volker Simonis | P4 | Resolved | Fixed | b01 |
JDK-8037995 | 8u20 | Volker Simonis | P4 | Resolved | Fixed | b09 |
JDK-8052478 | emb-8u26 | Volker Simonis | P4 | Resolved | Fixed | b18 |
Description
During the nashorn build, the nasgen tool is called as follows:
<boot_jdk>/bin/java \
-Xms64M -Xmx1100M \
-XX:PermSize=32m \
-XX:MaxPermSize=160m \
-XX:ThreadStackSize=1536 \
-cp "<build_dir>/nashorn/nasgen_classes:<build_dir>/nashorn/nashorn_classes"\
jdk.nashorn.internal.tools.nasgen.Main \
<build_dir>/nashorn/classes jdk.nashorn.internal.objects <build_dir>/nashorn/classes
The problem is that the call puts the newly created nashorn and nasgen class (which also include the required asm class) into the class path. This will lead to problems, if the boot jdk contains different version of some of these classes.
Until now, this problem was seldom, because the jdk7 doens't contain any of these classes, so no conflicts could occur. But building a new version of jdk8/jdk9 with an older jdk8 build may lead to build errors like this:
/share/software/Java/jdk1.8.0_ea_b70/bin/java -Xms64M -Xmx1100M -XX:ThreadStackSize=1536 \
-Xbootclasspath/p:"/tmp/jdk9-client-opt/nashorn/nasgen_classes" -cp "/tmp/jdk9-client-opt/nashorn/nashorn_classes" \
jdk.nashorn.internal.tools.nasgen.Main /tmp/jdk9-client-opt/nashorn/classes jdk.nashorn.internal.objects /tmp/jdk9-client-opt/nashorn/classes
Exception in thread "main" java.lang.NoClassDefFoundError: jdk/nashorn/internal/objects/annotations/ScriptClass
at jdk.nashorn.internal.tools.nasgen.ScriptClassInfo.<clinit>(ScriptClassInfo.java:52)
at jdk.nashorn.internal.tools.nasgen.ScriptClassInfoCollector.visitAnnotation(ScriptClassInfoCollector.java:82)
at jdk.internal.org.objectweb.asm.ClassReader.accept(ClassReader.java:670)
at jdk.internal.org.objectweb.asm.ClassReader.accept(ClassReader.java:535)
at jdk.nashorn.internal.tools.nasgen.ClassGenerator.getScriptClassInfo(ClassGenerator.java:370)
at jdk.nashorn.internal.tools.nasgen.ClassGenerator.getScriptClassInfo(ClassGenerator.java:365)
at jdk.nashorn.internal.tools.nasgen.Main.process(Main.java:104)
at jdk.nashorn.internal.tools.nasgen.Main.processAll(Main.java:88)
at jdk.nashorn.internal.tools.nasgen.Main.main(Main.java:62)
make[1]: *** [/tmp/jdk9-client-opt/nashorn/classes/_the.nasgen.run] Error 1
make[1]: Leaving directory `/net/usr.work/d046063/OpenJDK/jdk9-client/nashorn/make'
Also see the message "Compilation failure due to mismatching internal classes in the boot JDK" at http://mail.openjdk.java.net/pipermail/nashorn-dev/2014-January/002687.html
The fix for this is easy - just put the required classes in the boot class path instead just in the class path.
<boot_jdk>/bin/java \
-Xms64M -Xmx1100M \
-XX:PermSize=32m \
-XX:MaxPermSize=160m \
-XX:ThreadStackSize=1536 \
-cp "<build_dir>/nashorn/nasgen_classes:<build_dir>/nashorn/nashorn_classes"\
jdk.nashorn.internal.tools.nasgen.Main \
<build_dir>/nashorn/classes jdk.nashorn.internal.objects <build_dir>/nashorn/classes
The problem is that the call puts the newly created nashorn and nasgen class (which also include the required asm class) into the class path. This will lead to problems, if the boot jdk contains different version of some of these classes.
Until now, this problem was seldom, because the jdk7 doens't contain any of these classes, so no conflicts could occur. But building a new version of jdk8/jdk9 with an older jdk8 build may lead to build errors like this:
/share/software/Java/jdk1.8.0_ea_b70/bin/java -Xms64M -Xmx1100M -XX:ThreadStackSize=1536 \
-Xbootclasspath/p:"/tmp/jdk9-client-opt/nashorn/nasgen_classes" -cp "/tmp/jdk9-client-opt/nashorn/nashorn_classes" \
jdk.nashorn.internal.tools.nasgen.Main /tmp/jdk9-client-opt/nashorn/classes jdk.nashorn.internal.objects /tmp/jdk9-client-opt/nashorn/classes
Exception in thread "main" java.lang.NoClassDefFoundError: jdk/nashorn/internal/objects/annotations/ScriptClass
at jdk.nashorn.internal.tools.nasgen.ScriptClassInfo.<clinit>(ScriptClassInfo.java:52)
at jdk.nashorn.internal.tools.nasgen.ScriptClassInfoCollector.visitAnnotation(ScriptClassInfoCollector.java:82)
at jdk.internal.org.objectweb.asm.ClassReader.accept(ClassReader.java:670)
at jdk.internal.org.objectweb.asm.ClassReader.accept(ClassReader.java:535)
at jdk.nashorn.internal.tools.nasgen.ClassGenerator.getScriptClassInfo(ClassGenerator.java:370)
at jdk.nashorn.internal.tools.nasgen.ClassGenerator.getScriptClassInfo(ClassGenerator.java:365)
at jdk.nashorn.internal.tools.nasgen.Main.process(Main.java:104)
at jdk.nashorn.internal.tools.nasgen.Main.processAll(Main.java:88)
at jdk.nashorn.internal.tools.nasgen.Main.main(Main.java:62)
make[1]: *** [/tmp/jdk9-client-opt/nashorn/classes/_the.nasgen.run] Error 1
make[1]: Leaving directory `/net/usr.work/d046063/OpenJDK/jdk9-client/nashorn/make'
Also see the message "Compilation failure due to mismatching internal classes in the boot JDK" at http://mail.openjdk.java.net/pipermail/nashorn-dev/2014-January/002687.html
The fix for this is easy - just put the required classes in the boot class path instead just in the class path.
Attachments
Issue Links
- backported by
-
JDK-8037995 nasgen needs the newly build nasgen and nashorn classes in the bootclasspath
-
- Resolved
-
-
JDK-8045078 nasgen needs the newly build nasgen and nashorn classes in the bootclasspath
-
- Resolved
-
-
JDK-8052478 nasgen needs the newly build nasgen and nashorn classes in the bootclasspath
-
- Resolved
-