Java Path and Classpath explained in detail
In this blog post, I will be explaining Java PATH and CLASSPATH. Both PATH and CLASSPATH are environment variables that need to be set in order for Java programs to run. But there is a slight difference between the two. Let’s find out. What is Path? The PATH environment variable is used to specify where the JDK binaries like “java” or “javac” are present. You will generally require these binaries to compile or run your program. The “javac” or “java” are exe files provided by Java to compile or run your code. These are present in the JDK_HOME\bin folder. So if you want to compile or run your program, you need to do one of the following: 1) Navigate to the JDK_HOME\bin and type the javac or java command along with the full path of your Java file: 2) Stay in the directory where your Java files exist but specify the full path of the JDK_HOME\bin folder with the java ir javac command. Both these methods are cumbersome and so the e...