| Summary: | cannot launch java project on JDK9 anymore | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Martin Lippert <mlippert> |
| Component: | Debug | Assignee: | Sarika Sinha <sarika.sinha> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | critical | ||
| Priority: | P3 | CC: | jarthana, sarika.sinha, stephan.herrmann |
| Version: | 4.8 | ||
| Target Milestone: | BETA J18.3 | ||
| Hardware: | Macintosh | ||
| OS: | Mac OS X | ||
| See Also: |
https://git.eclipse.org/r/119510 https://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=c9a1f05d85f965a727e6ca01b023ff94985ef8c8 https://git.eclipse.org/r/119663 https://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=9eaef85b313f20ed7cc67182a9c51f357d205924 https://bugs.eclipse.org/bugs/show_bug.cgi?id=542571 |
||
| Whiteboard: | |||
Environment: macOS High Sierra (10.13.3) === Eclipse IDE for Java Developers Version: Photon Milestone 5 (4.8.0M5) Build id: 20180314-2134 === org.eclipse.jdt.launching bundle is from: 3.10.0.v20180303-2257 === Eclipse itself running on a JDK 1.8.0_161 (In reply to Martin Lippert from comment #0) > I have the simplest Java app around: > > package javademo; > > public class MyMain { > > public static void main(String[] args) { > System.out.println("Hello World!"); > } > > } > > > It is configured for JDK 1.8. > > => launching this on JDK 1.8 JRE/JDK works > => launching this on JDK9 (9.0.4) fails with this message: > > === > > Error occurred during initialization of boot layer > java.lang.LayerInstantiationException: Package > jdk.internal.jimage.decompressor in both module jrt.fs and module java.base > > === > > Switching the project to have JDK9 as the runtime JRE on the classpath > (instead of the JDK1.8) fixes the issue. Now you got me confused: the error happens when you launch on JDK9 and it can be fixed by switching to JDK9?? (In reply to Stephan Herrmann from comment #2) > (In reply to Martin Lippert from comment #0) > > === > > > > Error occurred during initialization of boot layer > > java.lang.LayerInstantiationException: Package > > jdk.internal.jimage.decompressor in both module jrt.fs and module java.base > > > > === Of course, this *is* bogus: jrt.fs is not a module contained in any JDK 9 image. Perhaps you have a mix of both 1.8 and 9 System libraries on the runtime classpath? Hint: after the (failed) launch: go to the Debug View, select the second node, its properties contain the full command line that was used for launching. What's it say? @Sarika, maybe I can sell stick notes with this hint ;p (In reply to Stephan Herrmann from comment #2) > (In reply to Martin Lippert from comment #0) > Now you got me confused: the error happens when you launch on JDK9 and it > can be fixed by switching to JDK9?? Here is the matrix of what works and what doesn't: - project configured with 1.8, launched on JDK 1.8: works - project configured with 1.9, launched on JDK 9: works - project configured with 1.8, launched on JDK 9: BOOOOOOM... And it seems to be 100% reproduceable... :-) (In reply to Stephan Herrmann from comment #3) > (In reply to Stephan Herrmann from comment #2) > > (In reply to Martin Lippert from comment #0) > Hint: after the (failed) launch: go to the Debug View, select the second > node, its properties contain the full command line that was used for > launching. What's it say? Command Line: /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/bin/java -Dfile.encoding=UTF-8 -p /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/lib/jrt-fs.jar -classpath /Users/mlippert/Documents/eclipse-workspace-issue-launch-jdk9-jdk8/javademo/bin javademo.MyMain (In reply to Stephan Herrmann from comment #3) > @Sarika, maybe I can sell stick notes with this hint ;p What's the rate :) Any way I checked it is getting patched -p C:\Eclipse\Downloads\JDK\jdk-9\lib\jrt-fs.jar I see it happening on 4.7.3 also. New Gerrit change created: https://git.eclipse.org/r/119510 Gerrit change https://git.eclipse.org/r/119510 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=c9a1f05d85f965a727e6ca01b023ff94985ef8c8 (In reply to Eclipse Genie from comment #8) > Gerrit change https://git.eclipse.org/r/119510 was merged to [master]. > Commit: > http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/ > ?id=c9a1f05d85f965a727e6ca01b023ff94985ef8c8 Does this fix still do the right thing when bug 490103 is merged (and jrt-fs.jar no longer shows up in classpath entries)? I don't think that will impact but adding Jay to this, so that he can test this if breaks and report here. New Gerrit change created: https://git.eclipse.org/r/119663 (In reply to Stephan Herrmann from comment #9) > Does this fix still do the right thing when bug 490103 is merged (and > jrt-fs.jar no longer shows up in classpath entries)? At the moment, that fix is not going anywhere :( But it will have an impact, but I already see what needs to be done. And without that fix, I don't think Sarika has a choice anyway. Gerrit change https://git.eclipse.org/r/119663 was merged to [BETA_JAVA_18_3]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=9eaef85b313f20ed7cc67182a9c51f357d205924 verified using Eclipse SDK Version: Photon (4.8) Build id: I20180322-0645 |
I have the simplest Java app around: package javademo; public class MyMain { public static void main(String[] args) { System.out.println("Hello World!"); } } It is configured for JDK 1.8. => launching this on JDK 1.8 JRE/JDK works => launching this on JDK9 (9.0.4) fails with this message: === Error occurred during initialization of boot layer java.lang.LayerInstantiationException: Package jdk.internal.jimage.decompressor in both module jrt.fs and module java.base === Switching the project to have JDK9 as the runtime JRE on the classpath (instead of the JDK1.8) fixes the issue. This is a major regression compared to Oxygen.2 (tested that, too). Launching a JDK1.8-based project on a JDK 1.8 and a JDK 9 works both out-of-the-box.