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

improvement: Allow to override metals java home #1559

Merged
merged 3 commits into from
Jan 8, 2025

Conversation

tgodzik
Copy link
Contributor

@tgodzik tgodzik commented Dec 12, 2024

Peviously, if use had JAVA_HOME and java on PATH pointing to JDK 11, we would download JDK 17 using coursier. This however might not work if there is no internet and there was no way to work around that. Now, we allow users to specify an override for those cases.

Fixes #1558

@tgodzik tgodzik requested a review from kasiaMarek December 12, 2024 15:39
@tgodzik tgodzik changed the title improvement: Allow to override mtals java home improvement: Allow to override metals java home Dec 12, 2024
Peviously, if use had JAVA_HOME and java on PATH pointing to JDK 11, we would download JDK 17 using coursier. This however might not work if there is no internet and there was no way to work around that. Now, we allow users to specify an override for those cases.

Fixes scalameta#1558
@tgodzik tgodzik requested review from kasiaMarek and removed request for kasiaMarek January 8, 2025 12:53
packages/metals-vscode/package.json Outdated Show resolved Hide resolved
packages/metals-languageclient/src/setupCoursier.ts Outdated Show resolved Hide resolved
return workspace
.getConfiguration("metals")
.get<string>(UserConfiguration.MetalsJavaHome)
?.trim();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe if empty string you want to return undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@tgodzik tgodzik requested a review from kasiaMarek January 8, 2025 16:35
@tgodzik tgodzik force-pushed the override-java-home branch from a8e5b7d to c745a6b Compare January 8, 2025 16:48
@tgodzik tgodzik merged commit d30a07d into scalameta:main Jan 8, 2025
10 checks passed
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

Successfully merging this pull request may close these issues.

Unable to use local java version different from system-wide default for Metals
2 participants