Compiling a java program

I have JRE 6 on my PC (Windows XP), but when I compile the program on the command line, it shows javac is not recognised as internal or external command . What software is needed to compile a Java program?

+6
java javac
source share
6 answers

You need to download and install the JDK , not the JRE .

As a (very crude) explanation, the JRE contains only the Java Virtual Machine , while the JDK contains not only the JRE, but also the compiler ( javac ), some debugging tools ( javap , jvisualvm , ...), additional libraries and API documentation .

See also:

+12
source share

I suggest you follow the steps of Hello World! Study guide .

In accordance with the instructions:

  • Download JDK6 . (Make sure you download the JDK , not the JRE.)
  • Update the PATH variable to be able to conveniently run JDK executables, such as javac from any directory, without entering the full path to the command
+3
source share

JRE stands for Java Runtime Environment. It allows you to run already compiled java programs. To compile your own programs, you need the JDK, which stands for Java Development Kit. You can download it from the JDK Download Page .

+1
source share

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

+1
source share

Instead of a simple JRE, you will need a full JDK. For example, youc download the sun here: http://www.oracle.com/technetwork/java/javase/downloads/index.html#need (and don't forget to select "download JDK").

0
source share

JDK is needed for application development, while JRE is enough to run applications. In other words, the JRE is enough to run the application (that is, it includes java.exe and does not contain javac.exe. JDK contains java.exe and javac.exe

There are other chances that you have set your class path correctly.

0
source share

All Articles