redhat-developer / redhat-developer/vscode-java

java.home Path Cannot be Relative

Aperta
#1,070 1 commento 5 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement preferences ux
Lingua principale
TypeScript
Stelle
2.3k
Fork
546
Merge medio
20h 1m
PR unite (30g)
11

Descrizione

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
  1. Download VS Code Windows ZIP archive into a USB disk
  2. Enable the VS Code portable mode (creating “data” folder) https://code.visualstudio.com/docs/editor/portable
  3. Download the JDK binary into the USB disk
  4. Open the VS Code and install the Java Pack extension, the extensions should appear in the data folder
  5. 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)

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dall'impostazione java.home in Settings.json e confrontane la gestione con quella di python.pythonPath, usando la riproduzione in Windows portable-mode descritta nell'issue. Traccia il modo in cui l'estensione Java risolve il percorso del JDK e chiarisci la posizione di base prevista per i percorsi relativi; il lavoro è completato quando la struttura USB funziona da diverse lettere di unità senza un percorso assoluto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java, typescript, vscode
Ambito
developer-experience, tooling
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
32/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.