I am polishing support for [JEP-330|https://openjdk.java.net/jeps/330] in NetBeans ([PR-2938|https://github.com/apache/netbeans/pull/2938]) and I have problems with debugging. Local variables aren't visible as the compiler doesn't pass -g option when compiling the main class. That would require one to pass -g option to the compiler somehow. As far as I can say there is no such way and hence I decided to create this pull request. If I invoke:
$ java -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y x.java
it detects JDWP is on and adds -g to the compiler arguments. Is this an acceptable improvement? The alternative is to avoid using JEP-330 when debugging and rather generate .class by invoking javac and then run it as usual, but I'd rather rely on JEP-330 and avoid creation of the .class file.
$ java -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y x.java
it detects JDWP is on and adds -g to the compiler arguments. Is this an acceptable improvement? The alternative is to avoid using JEP-330 when debugging and rather generate .class by invoking javac and then run it as usual, but I'd rather rely on JEP-330 and avoid creation of the .class file.
- csr for
-
JDK-8266882 Missing local debug information when debugging JEP-330
- Closed