Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't set up JDK on Visual Studio Code

I saw this:

Java runtime could not be located

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.

like image 712
İmran Durmuş Avatar asked Sep 27 '18 14:09

İmran Durmuş


People also ask

How install JDK path VS code?

Open “User Setting” from clicking of “Setting icon” from left bottom like windows visual studio code. click on edit Icon, “java. home” will added into “3” user custom setting option. Add the “JDK HOME” directory to “java.

Do we need to install JDK for Vscode?

To use Java within Visual Studio Code, you need to install a Java Development Kit (JDK) on your local environment. JDK is a software development environment used for developing Java applications.

Does Visual Studio require JDK?

Android for Visual Studio requires Java Development Kit. Please install it or set Java Development Kit path on Tools->Options->Xamarin->Android Settings menu.


1 Answers

  • 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, e.g: "java.home": "C:/Program Files/Java/jdk-11.0.2")

like image 200
amirali Avatar answered Sep 21 '22 04:09

amirali