skip to Main Content

"Error: Java_home not found in your environment.
Please set the java_home variable in your environment to match the location of your installation"

I try to create a small project in visual studio code so I installed Java extension pack, and it keeps displaying this error message, and I have tried to make some changes in my system environment but it still not working out, I use java-maven, maven-archetype-quickstart, version 1.4.
I expect it run smoothly.

3

Answers


  1. I hope this helps you:

    • Check your JAVA_HOME variable using echo.
    • If the variable is not set, set it.

    How to do this for different operating systems can be seen here: Set JAVA_HOME Variable.

    P.S. Of course you must have a JDK installed on your system.

    Login or Signup to reply.
  2. Do basic settings.

    1. press ShortKey (Ctrl+Shift+P) : Command Palette
    2. select "Java: Configure Java Runtime"
    3. see which JDKs are used for your projects
    Login or Signup to reply.
  3. Vscode Java Development Pack default depend on your system JDK, if you not install, try install it by following this toturial https://www3.ntu.edu.sg/home/ehchua/programming/howto/jdk_howto.html

    If you installed, open the VS Code terminal and run java --version to check whether JAVA_HOME is added to your PATH. If everything is correct, it will print the Java version. If an error occurs, you should set the environment variable by following this link: https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search