microsoft / microsoft/vscode-java-pack
Feature Request: Set `default` in `java.configuration.runtimes` to the workspace environment variable JAVA_HOME
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 352
- Fork
- 166
- Merge medio
- 17h 47m
- PR unite (30g)
- 32
Descrizione
Currently, the default of the Java extension java.configuration.runtimes is used as the default for No Build Tools, but it would be useful to set it to the environment variable JAVA_HOME which is valid for each workspace. The environment variable here is not the terminal, but process.env.JAVA_HOME, which is referenced by extensions such as
java.import.gradle.java.home
Setting > java.jdt.ls.java.home > JAVA_HOME > PATHmaven.terminal.customEnv
Setting > JAVA_HOMEjava.jdt.ls.java.home
Setting > Embedded JRE > JDK_HOME > JAVA_HOME > PATHspring-boot.ls.java.home
Setting > Embedded JRE > JAVA_HOME > PATHrsp-ui.rsp.java.home
Setting > JDK_HOME > JAVA_HOME> Windows Registry > PATHsalesforcedx-vscode-apex.java.home
Setting > JDK_HOME > JAVA_HOME> Windows Registry > PATHplantuml.java
Setting > PATH
The goal is to be able to use a different JAVA_HOME for each workspace, independent of the system's JAVA_HOME environment variable. For example:
User settings.json
"java.configuration.runtimes": [
{
"name": "JavaSE-17",
"path": "/path/to/java/17",
"default": true
},
{
"name": "JavaSE-21",
"path": "/path/to/java/21",
}
],
Workspace settings.json (Override default runtime to JavaSE-21)
"java.configuration.runtimes": [
{
"name": "JavaSE-21",
"path": "/path/to/java/21",
"default": true
}
],
java.configuration.runtimes is a Red Hat extension, but I am posting it here because I believe it needs to be supported by VSCode itself. It is related to the following issues.
#152806 API: allow an extension to change the environment variables
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia esaminando l’issue correlata di VS Code API #152806 e gli esempi di impostazioni dell’area di lavoro e dell’utente presenti in questa issue. Il lavoro è completato quando si determina se workspace process.env.JAVA_HOME può sovrascrivere il runtime Java predefinito indipendentemente dall’ambiente di sistema, applicando questo comportamento alle impostazioni relative a Java elencate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java, vscode
- Ambito
- developer-experience, tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 25/100