redhat-developer / redhat-developer/vscode-java

Irrelevant "Invalid runtime for JavaSE-21" on start with WSL

Aperta
#4,456 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

Describe the bug
I run vscode with WSL.

Bujt on startup, I get this message:

"Invalid runtime for JavaSE-21: The path points to a missing or inaccessible folder (c:\Program Files\Amazon Corretto\jdk21.0.9_10)."

It should not try a Windows path from WSL Remote. I suspect it either walks over all $PATH entries, or falsely evaluates the Windows side JAVA_HOME.

After closing the message, everything works fine, it correctly uses the JDK in Linux/WSL for everything.

To Reproduce
(Have a valid JDK installed in Windows. I have it in the Windows PATH, and JAVA_HOME set)
Steps to reproduce the behavior:

  1. Start VSCode on a project residing in WSL
  2. Wait a few seconds for the message to pop up.

Expected behavior
Not showing that message.

Environment

  • Operating System: Windows
  • JDK version: 21 (The mistakenly picked up Amazon Corretto on Windows, and either OpenJDK or Corretto within WSL)
  • Visual Studio Code version: 1.127.0
  • Java extension version: 1.55.0

Additional Information
I tried these things:

  • Checking for the path in any configuration (workspace, user, WSL, project)
  • deleting ~/.vscode-server completely in WSL
  • deleting globalStorage and workspaceStorage in Windows %APPDATA%
  • disable "Detect JDK at startup" option, no effect.

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 riproducendo l’avviso di avvio in un progetto VS Code aperto tramite WSL, quindi analizza il rilevamento del runtime Java e il modo in cui Windows PATH o JAVA_HOME viene valutato nel contesto remoto. Il lavoro è completato quando il JDK Windows non viene segnalato come non valido, mentre continua a essere utilizzato il JDK WSL valido e non viene visualizzato alcun avviso.

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

Valutazione

Stack tecnologico
java, typescript, vscode
Ambito
devtools, operating-systems, tooling
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.