redhat-developer / redhat-developer/vscode-java

Overwrites java home in .settings/org.eclipse.buildship.core.prefs

Open
#2,293 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Gradle preferences
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

As vscode-java is apparently not capable of generating the .settings/org.eclipse.buildship.core.prefs file (mabe #666), I have to check it into git.
But everytime vscode-java tries to set the java.home= field in this file to my local path to the local JDK, which might differ from other developers workspace setups.

Environment
  • Operating System: Windows 10
  • JDK version: Amazon Corretto 11
  • Visual Studio Code version: 1.63.2
  • Java extension version: 1.2.0
Steps To Reproduce
  1. Open/Import a Java project folder with Gradle build (worked for me only after having an Eclipse IDE instance generate the .settings/org.eclipse.buildship.core.prefs file)
  2. set the java.home= line to an empty value. VSCode seems to work fine nevertheless.
  3. Use VSCode, run your project, develop... At some point something changes the file to set the value to the lokal JDK path (e.g. C\:/Program Files/Amazon Corretto/jdk11.0.12_7) This can be forced by "Java: Clean the Java Language Server Workspace"

[Please attach a sample project reproducing the error]
I guess it's not an error per se.

Please attach logs
vscode-java.log

Current Result

See above.

Expected Result

The .settings/org.eclipse.buildship.core.prefs file should either be committable (thus workspace-agnostic) or generateable (so it does not have to be committed to git).

Additional Informations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the committed .settings/org.eclipse.buildship.core.prefs file and reproduce the change using “Java: Clean the Java Language Server Workspace” in the reported Windows and JDK setup. Use the linked vscode-java.log to identify what rewrites java.home; done means the preference remains workspace-agnostic or the file can be generated without requiring a machine-specific path.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, vscode
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.