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


I would like to know what JAVA_HOME is. 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 prompt, how does the JVM find javac.exe?


JVM does not find java.exe. It doesn’t even call it. java.exe is called by the operating system (Windows in this case).

JAVA_HOME is just a convention, usually used by Tomcat, other Java EE app servers and build tools such as Gradle to find where Java lives.

The important thing from your point of view is that the Java /bin directory be on your PATH so Windows can find the .exe tools that ship with the JDK: javac.exe, java.exe, jar.exe, etc.

Answered By – duffymo

Answer Checked By – Mary Flores (Easybugfix Volunteer)

Leave a Reply

(*) Required, Your email will not be published