8000 Automatically add -XX:+ShowCodeDetailsInExceptionMessages when launching · Issue #797 · microsoft/vscode-java-debug · GitHub
[go: up one dir, main page]

Skip to content

Automatically add -XX:+ShowCodeDetailsInExceptionMessages when launching #797

@fbricon

Description

@fbricon

When a program is launched with Java 14, it might be useful to automatically add -XX:+ShowCodeDetailsInExceptionMessages to the vmArgs, so that NPEs provide better troubleshooting informations. See https://www.baeldung.com/java-14-nullpointerexception for more details.

The flag should be added dynamically during launch, if not already present in the launch.json's "vmArgs" option. Better not generate the launch.json with the flag directly in it, as things will go wrong if the project's JDK version changes:

Unrecognized VM option 'ShowCodeDetailsInExceptionMessages'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

This enhanced behavior could be disabled with a new setting.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0