redhat-developer / redhat-developer/vscode-java
java.home Path Cannot be Relative
Personne n'a encore pris cette issue.
- Langage dominant
- TypeScript
- Étoiles
- 2.3k
- Forks
- 546
- Merge moyen
- 20 h 1 min
- PR mergées (30 j)
- 11
Description
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)
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par le paramètre java.home dans Settings.json et comparez sa gestion avec celle de python.pythonPath, en utilisant la reproduction en Windows portable-mode décrite dans l’issue. Suivez la manière dont l’extension Java résout le chemin du JDK et clarifiez l’emplacement de base prévu pour les chemins relatifs ; le travail est considéré comme terminé lorsque la disposition USB fonctionne depuis différentes lettres de lecteur sans chemin absolu.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java, typescript, vscode
- Domaine
- developer-experience, tooling
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 32/100