You are on page 1of 1

JDK vs JRE JDK stands for Java Development Kit and JRE stands for Java Runtime Environment.

To run a java application you need JRE and to develop java applications you nee d JDK. When you install JDK, JRE will be automatically installed, but not the ot her way. Please see jdk-jre-jvm-and-your-first-java-program. PATH vs CLASSPATH The PATH environment variable is something that the operating system uses to fin d executable files like java, javac. The PATH variable contains directories wher e executables (e.g. EXE files in Windows) will be looked for. If you type "javac " in command prompt, you should have the "bin" directory of your jdk into the PA TH or you should be executing from the bin directory, otherwise you'll get "Comm and not found" error message. This is because operating system will not be able to find javac.exe. So you have to tell the operating system the javac.exe path b y adding it to the PATH as below. If your path to jdk bin folder (where javac is there) is 'C:\Program Files\Java\ jdk1.6.0_13\bin', then you can add it to path in windows as: set PATH=C:\Program Files\Java\jdk1.6.0_13\bin;%PATH% then type javac and see if you are getting a not found error or not. The CLASSPATH environment variable is typically something that implementations o f the JVM use to find Java class files. The CLASSPATH contains directories (or J AR files), from where your java compiler/runtime will look for .class files (and some others). Even the current directory needed to be added. The current direct ory, denoted by dot (.). Verify this by checking your class path variable. Howev er if class path variable is not set at all, java will set the current directory by default. To add current directory to CLASSPATH, add .; at the beginning or ;. at the end of your CLASSPATH. In DOS the separator is semi-column(;) whereas in linux it is column(:). You can also specify classpath along with java command as: java -classpath . HelloWorld or java -cp . HelloWorld Here we are adding . to classpath. You can add any classpath here.

You might also like