A java program (source code) is usually compiled to byte-code
and then converted to the machine code either by compilation (using the Just-In-Time compiler) or by interpretation (using the JVM interpreter).
To compile a Java program, you need a java-compiler (usually referred to as javac
). To run a compiled java program, you need a Java Run Time Environment (also called JRE
). The Java Run Time Environment is provided by Java
Hence, you need to have
to compile and run your Java program.
But, there is no official download link to download javac
alone. What you need to do is to download the Java Development Kit (JDK) and install it in your system. The JDK includes both the JRE and Javac along with the packages and other program development kit.JDK = JRE + javac
You can download the JDK from Oracle
. Even if the JDK that you have installed does not have Java (JRE) or there is an error in using the Java that comes along with the JDK, you can download both from the same link.
If you want to download Java separately, you can download it from Java
Hope that helps!