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 prompt, how does the JVM find
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: