| Summary: | Debug expressions in system classes w/modules cause "The package X is accessible from more than one module: Y" | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Jesper Moller <jesper> |
| Component: | Debug | Assignee: | JDT-Debug-Inbox <jdt-debug-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | dragonmacher, loskutov, sarika.sinha |
| Version: | 4.15 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
(In reply to Jesper Moller from comment #0) > Steps to reproduce > > Make a Java project with a module-info, add a breakpoint at > StringBuilder.append(String), start debugging, and try to evaluate anything. > > void main(String args[]) { > System.out.println("Hello, " + args[0]); > } > > You'll get the error: "The package java.lang is accessible from more than > one module: java.base, Xxx" > > (Not related to lambdas specifically, by the way, caused by trying to > compile an expression in an imported package, as fas as I can tell) I tried to run this in Debug Shell System.out.println(str); and I see the reason as: Evaluation failed. Reason(s): Evaluations must contain either an expression or a block of well-formed statements (In reply to Sarika Sinha from comment #1) I wasn't clear about this: The code shown should go into a Java file in a project project, and the error message shows up in the log of the debugger, not in the debug expressions view. I can confirm this issue. This is a major impediment to my debugging workflow.
I see this issue when I set a breakpoint in a javax.swing package. When that breakpoint hits and I try to use the Debug Shell window to execute statements, the Debug Shell prints:
"Evaluations must contain either an expression or a block of well-formed statements"
The Error Log has an entry that shows:
"Compile error during code evaluation: The package javax.swing is accessible from more than one module: <unnamed>, java.desktop"
I use this feature to debug things happening inside of Java's libraries.
System Info:
>java --version
openjdk 11.0.4 2019-07-16 LTS
OpenJDK Runtime Environment Corretto-11.0.4.11.1 (build 11.0.4+11-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.4.11.1 (build 11.0.4+11-LTS, mixed mode)
Eclipse IDE for Java Developers (includes Incubating components)
Version: 2021-06 (4.20.0)
Build id: 20210612-2011
Amazon Linux OS
*** This bug has been marked as a duplicate of bug 575039 *** |
Steps to reproduce Make a Java project with a module-info, add a breakpoint at StringBuilder.append(String), start debugging, and try to evaluate anything. void main(String args[]) { System.out.println("Hello, " + args[0]); } You'll get the error: "The package java.lang is accessible from more than one module: java.base, Xxx" (Not related to lambdas specifically, by the way, caused by trying to compile an expression in an imported package, as fas as I can tell)