Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Debugging

Janne Valkealahti edited this page Nov 13, 2023 · 2 revisions

Debugging a shell application is theoretically same as debugging any other jvm process, however the shell part of it will complicate things as IDE’s have different type of support running a proper command-line applications.

  • VSCode probably has a best support as you can directly start a shell in a debug mode directly within IDE.

  • STS/Eclipse contains some sort of a support running a shell but it’s implementation is missing most of a modern shell capabilities.

  • IDEA is currently probably a worst one as in a debug mode it seems to connect directly to jvm input/output streams and fully misses shell capabilities.

If you’re unable to directly launch shell application in a debug mode within IDE, one workaround is to use your favourite shell and start jvm process with a debug mode:

java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=127.0.0.1:8000 -jar target/demo-0.0.1-SNAPSHOT.jar

And then connect your IDE to it as an external debug target.

Your IDE compiler may not use flag to preserve method argument names which then breaks commands where option is resolved an actual argument name. With vscode you may need to i.e. set java.settings.url to custom prefs file having something like:

org.eclipse.jdt.core.compiler.codegen.methodParameters=generate

Clone this wiki locally

Morty Proxy This is a proxified and sanitized view of the page, visit original site.