Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

`java.jdt.ls.java.home` should use the Java execution environment name

Offen
#4,422 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 4 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
java, typescript, vscode

Rechercherichtung

Es werden keine Implementierungsdateien oder Tests genannt. Beginne mit der Verarbeitung von java.jdt.ls.java.home und java.configuration.runtimes, wobei das Beispiel .vscode/settings.json als Einstiegspunkt auf Workspace-Ebene verwendet wird. Die Aufgabe ist abgeschlossen, wenn ein Projekt eine Runtime anhand ihres Namens der Ausführungsumgebung auswählen kann, während jeder Benutzer diesen Namen zu seinem eigenen JDK-Pfad auflöst.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement

Description

I've been trying to configure several Java projects in Visual Studio Code and have noticed that the java.jdt.ls.java.home setting, among others, is always required.

This setting belongs in the project's workspace (unless you work in one project, or have a perfectly aligned setup), but it cannot be set as such because for a multi-user project, each one will definitely have a different path for the JDK.

I think it would be great if this setting could take the (reference) value of one the existing Java execution environments instead, and tries to read the path of the corresponding JDK. This way, the configuration is fixed, set at the project level, and only needs to change if the project upgrades to a newer JDK.

For instance:

// Global User Settings
{
  ...
  "java.configuration.runtimes": [
    {
      "javadoc": "https://docs.oracle.com/en/java/javase/17/docs/api/index.html",
      "name": "JavaSE-17",
      "path": "/home/x80486/.local/share/mise/installs/java/temurin-17",
      "sources": "/home/x80486/.local/share/mise/installs/java/temurin-17/lib/src.zip"
    },
    {
      "default": true,
      "javadoc": "https://docs.oracle.com/en/java/javase/21/docs/api/index.html",
      "name": "JavaSE-21",
      "path": "/home/x80486/.local/share/mise/installs/java/temurin-21",
      "sources": "/home/x80486/.local/share/mise/installs/java/temurin-21/lib/src.zip"
    }
  ],
  ...
}

Then for each project I work on, I could just set in .vscode/settings.json:

{
  "java.jdt.ls.java.home": "JavaSE-21"
}

Additional Context

This is just an idea with the existing settings. It may be even more appropriate to define something new that could unify all the settings that request the location of the JDK, but it should always refer in one way or another to the java.configuration.runtimes (preferably by name), otherwise it's impossible to set this correctly —in a way that works for everyone regardless of the architecture and location/installation of the Java SDK—, at the project level.

Vorherrschende Sprache
TypeScript
Sterne
2.3k
Forks
547
Ø Merge
5 Std. 36 Min.
Gemergte PRs (30 T.)
10

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus redhat-developer/vscode-java

Alle Issues in redhat-developer/vscode-java

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.