how to inform debugger of already-built jar file to prevent the extension from doing a build #1353
Unanswered
KimTheLearner
asked this question in
Q&A
Replies: 1 comment
-
If you don’t want to trigger a build when debugging, you can switch to the attach mode instead of the launch mode. You can find more details here: #120 (comment) With the attach mode, you can use a custom tasks.json file to configure the preLaunch task. This task can run your custom build and launch commands. The debugger will then attach to the existing process for debugging. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My Java project is built with a makefile, so I have a .jar file already built, located in a subdirectory of the workspace. How can I inform 'Debugger for Java' of that? When I click F5, it does an unnecessary build of the project into a jar file in my temp folder and uses that in the debug session, e.g.,
k: && cd "k:\Thoth\Thoth-Dev" && cmd /C ""C:\Program Files\Java\jdk1.8.0_311\bin\java.exe" -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:62938 -cp C:\Users(Xxxx)\AppData\Local\Temp\cp_4ab30fqb4rwtkbuciuqs9wims.jar Thoth "
A debugger for another language in VS Code utilizes the property "program": "objdbg/EsperVocab.exe" in the launch.json file (and I know "program" is not universal), but I can find no parallel in DforJ.
I have searched much. I've tried "modulePaths" in launch.json, to no avail.
I saw a mention of Maven and other projects: "Open a Java project (Maven/Gradle/Eclipse/Single Java file)", which my project is not, as stated above.
Is there a way I can specify the jar file already built for my makefile type project, to be used for the debug session?
launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug",
"request": "launch",
"mainClass": "Thoth"
}
]
}
WIndows 10
note: I am new at using VS Code with Java.
thanks!
Beta Was this translation helpful? Give feedback.
All reactions