6

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?

1
  • 1
    You weren't satisfied by any of the answers? Commented Dec 4, 2010 at 17:57

6 Answers 6

12

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:

Sign up to request clarification or add additional context in comments.

1 Comment

To make it even clearer, the JDK includes the JRE (plus the other things that you list).
3

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 javac from any directory without having to type the full path of the command

Comments

1

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

1

You need to install JDK-6 (Java Development Kit) which contains javac Java compiler. JRE does not contain it.

Comments

0

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

0

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.