vscode-java-debug icon indicating copy to clipboard operation
vscode-java-debug copied to clipboard

Don't inject classpath into modulePaths config

Open brunoborges opened this issue 6 years ago • 5 comments

It is OK to leave modulePaths empty. What is not OK is to inject the classPaths into modulePaths.

brunoborges avatar Aug 30 '19 21:08 brunoborges

Hey @hexiaokai, I see limitations in working with modules (Java 9+) on VS Code. First issue I found is that it is incorrectly injecting a classpath into the modulePaths property.

brunoborges avatar Aug 30 '19 21:08 brunoborges

@brunoborges could you provide a sample project to help reproduce this issue? i'm trying to understand the purpose of the fix...

testforstephen avatar Sep 02 '19 03:09 testforstephen

https://github.com/brunoborges/fx2048 is a Java project that uses Gradle to run, and so far it has been extremely painful to get VS Code to debug it.

brunoborges avatar Sep 02 '19 03:09 brunoborges

this project is using JavaFX 12, actually it needs to be launched as modules. Currently the debugger put the javafx libraries into -cp, that's the reason for the failure. They should be placed at --module-path instead of --classpath arguments. For example, the following command is able to launch 2048 game.

"C:\Program Files\Java\jdk-11.0.1\bin\java"  -Dfile.encoding=UTF-8 --module-path C:\Work\Debugger\Bug_Cases\fx2048\bin\main;C:\Users\jinbwan\.gradle\caches\modules-2\files-2.1\org.openjfx\javafx-controls\12\45d9af154b384e2eb9d787f5d8621b4f54df0d28\javafx-controls-12-win.jar;C:\Users\jinbwan\.gradle\caches\modules-2\files-2.1\org.openjfx\javafx-graphics\12\ec4fc19a5d3469da4a7539ce0cc7d2b48bf484d0\javafx-graphics-12-win.jar;C:\Users\jinbwan\.gradle\caches\modules-2\files-2.1\org.openjfx\javafx-graphics\12\8796b8816a3272d8ee4660e7f4627d61243c4084\javafx-graphics-12.jar;C:\Users\jinbwan\.gradle\caches\modules-2\files-2.1\org.openjfx\javafx-base\12\70354cbca618a7a61d46a10539d079dca345f535\javafx-base-12-win.jar;C:\Users\jinbwan\.gradle\caches\modules-2\files-2.1\org.openjfx\javafx-base\12\3179ee52ad6d4cf3ccd306e48f3d8cbf9078b038\javafx-base-12.jar -m fxgame/game2048.Game2048

testforstephen avatar Sep 02 '19 06:09 testforstephen

I'm not following...

brunoborges avatar Sep 02 '19 08:09 brunoborges