redhat-developer / redhat-developer/vscode-java
java.home Path Cannot be Relative
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 2.3k
- Forks
- 546
- Ø Merge
- 20 Std. 1 Min.
- Gemergte PRs (30 T.)
- 11
Beschreibung
I need to be able to use a relative path when specifying my jdk because I am making a USB version of visual studio that can be used on any computer. If that USB is in the E: (or any other) drive instead of the regular D: we’d have to manually change the path. The python module was able to use a combination of “..\..\” (Example below) to navigate to the relative location of python.exe. Is there a way to do this for the java.home variable, or an extension that adds this functionality?
In Settings.json:
"java.home": "..\..\..\..\..\..\Java12\jdk-12.0.2", //Doesn’t work
"python.pythonPath": "..\..\..\..\..\..\Python\python.exe", //Works
Environment
- Operating System: Windows
- JDK version: 12.0.2
- Visual Studio Code version: 1.38.1
- Java extension version: Redhat: 0.49.0; Java Extension Pack: 0.8.0
Steps To Reproduce
- Download VS Code Windows ZIP archive into a USB disk
- Enable the VS Code portable mode (creating “data” folder) https://code.visualstudio.com/docs/editor/portable
- Download the JDK binary into the USB disk
- Open the VS Code and install the Java Pack extension, the extensions should appear in the data folder
- Try and set Java.home to a relative location to VS Code, however it will never find the jdk unless you specify the entire path
Current Result
It cannot find the jdk without the entire path.
Expected Result
The path should point to the JDK relative to VSCode (or some starting position within vscode)
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie mit der Einstellung java.home in Settings.json und vergleichen Sie deren Handhabung mit python.pythonPath anhand der in der Issue beschriebenen Reproduktion im Windows-portable-mode. Verfolgen Sie, wie die Java-Erweiterung den JDK-Pfad auflöst, und klären Sie die vorgesehene Basisposition für relative Pfade; abgeschlossen ist die Arbeit, wenn das USB-Layout von unterschiedlichen Laufwerksbuchstaben aus ohne einen absoluten Pfad funktioniert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java, typescript, vscode
- Bereich
- developer-experience, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 32/100