Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support specifying explicit/separate JRE/JDK for a launch task #1487

Closed
tginiotis-at-work opened this issue Jun 6, 2024 · 3 comments
Closed
Assignees

Comments

@tginiotis-at-work
Copy link

tginiotis-at-work commented Jun 6, 2024

Currently the JDK/JRE that VSCode uses to launch a java type task from launch.json seems to be picked via some internal VSCode logic. This prevents from using different JDK/JREs for compile-time and run-time.

It would be useful to allow to explicitly define a java home in the launch configuration to be used for run-time.

Use-case: I am working on code in an aarch64 environment. The code can be compiled just fine with an aarch64 JDK, but for runtime, I want to launch it with an x86_64 emulated JDK, so it could load some dependent native x86_64 libs in run-time and etc.

I am able to compile with one JDK and launch the code with the emulated other arch JDK with some configuration juggling, but as you can imagine - that is far from ideal. A key in a the launch configuration specifying the JDK/JRE would be ideal. Other IDEs, like Eclipse and IntelliJ, allow specifying a separate run-time JDK/JRE too.

Might be related: #884

@testforstephen
Copy link
Contributor

In launch.json, we already support a settting "javaExec" to allow you specify a different java.exe to run the application.

@testforstephen testforstephen self-assigned this Jul 4, 2024
@tginiotis-at-work
Copy link
Author

Indeed, thanks! Could not find it documented anywhere.

@testforstephen
Copy link
Contributor

Added to the README doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants