What is JAVA_HOME? How does the JVM find the javac path stored in JAVA_HOME?

前端 未结 9 1623
情深已故
情深已故 2020-11-28 03:40

I would like to know what is JAVA_HOME. Where do I set the path of javac.exe and java.exe. It is in environment variables. When I compile a Java program from command prom

9条回答
  •  孤独总比滥情好
    2020-11-28 04:24

    JAVA HOME is used for setting up the environment variable for JAVA. It means that you are providing a path for compiling a JAVA program and also running the same. So, if you do not set the JAVA HOME( PATH ) and try to run a java or any dependent program in the command prompt.

    You will deal with an error as javac : not recognized as internal or external command. Now to set this, Just open your Java jdk then open bin folder then copy the PATH of that bin folder.

    Now, go to My computer right click on it----> select properties-----> select Advanced system settings----->Click on Environment Variables------>select New----->give a name in the text box Variable Name and then paste the path in Value.

    That's All!!

提交回复
热议问题