简体   繁体   中英

I can't set up JDK on Visual Studio Code

I saw this:

找不到 Java 运行时

clicked on it, it redirected me to Red Hat site and made me download Red Hat Developer Studio, but as I said I want it in Visual Studio Code. I did download JDK, but don't know what to do next.

  • Press Ctrl + comma .
  • Search for "java.home" .

In case you are on the newest vscode version:

  • Type in your java path( Don't forget to put the path in " " ).*

In case you are on an older version of vscode:

  • Click on the pencil next to the line starting with "java.home" .
  • click on "Copy to settings" .
  • Type in your java path( Don't forget to put the path in " " ).*
  • Press Ctrl + S .

*If you don't know your java path, type in which java in your terminal(On windows, Please note the right format, eg: "java.home": "C:/Program Files/Java/jdk-11.0.2" )

这对我不起作用,vsc 警告说“此设置将被弃用,请使用 te JAVA HOME”但我已配置

Shifting to java 11 did the trick for me. if you have settings.json then

"java.home": "/usr/lib/jvm/java-11-openjdk-amd64

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM