I have JRE 6 in my PC (Windows XP) but when I compile a program in the command prompt it shows javac is not recognised as internal or external command. Which software is needed to compile a Java program?
- 1You weren't satisfied by any of the answers?haylem– haylem2010-12-04 17:57:54 +00:00Commented Dec 4, 2010 at 17:57
6 Answers
You need to download and install a JDK, not a JRE.
As a (very rough) explanation, the JRE contains just the Java Virtual Machine, whereas the JDK contains not only the JRE but also the compiler (javac), some debugging tools (javap, jvisualvm, ...), extra libraries and the API documentation.
See also:
- What is the difference between JRE and JDK?
- as recommended by dogbane, you can follow the Java Hello World for Windows Tutorial.
1 Comment
I suggest you run through the steps of the Hello World! Tutorial.
As per the instructions:
- Download JDK6. (Make sure you download the JDK, not the JRE.)
- Update the PATH variable to be able to conveniently run the JDK executables such as
javacfrom any directory without having to type the full path of the command
Comments
JRE stands for Java Runtime Environment. It allows you to run already compiled java programs. To compile your own programs, you need JDK which stands for Java Development Kit. You can download it at JDK Downloads Page.
Comments
Instead of a simple JRE, you'll need a full JDK. As an example, youc an download sun one here : http://www.oracle.com/technetwork/java/javase/downloads/index.html#need (and don't forget to select "download JDK").
Comments
JDK is needed to develop applications whereas JRE is enough to run applications. In other words JRE is enough to run a application (i.e) it includes java.exe and doesnot contain javac.exe JDK contains both java.exe and javac.exe
There are also other chances that you dint set your class path properly.