Step 2 - Setup Java Development Kit (JDK):
If you do not have Java installed then you can install
the Java Software Development Kit (SDK) from Oracle's
Java site: Java SE Downloads. You will find instructions
for installing JDK in downloaded files, follow the given
instructions to install and configure the setup. Finally
set PATH and JAVA_HOME environment variables to refer to
the directory that contains java and javac, typically
java_install_dir/bin and java_install_dir respectively.
Set the JAVA_HOME environment variable to point to the
base directory location where Java is installed on your
machine. For example
OS Output
Windows Set the environment variable
JAVA_HOME to C:\Program Files\Java\jdk1.6.0_21
Linux export JAVA_HOME=/usr/local/java-current
Append Java compiler location to System Path.
OS Output
Windows Append the string ;%JAVA_HOME%\bin to
the end of the system variable, Path.
Linux export PATH=$PATH:$JAVA_HOME/bin/
Mac not required
Alternatively, if you use an Integrated Development
Environment (IDE) like Borland JBuilder, Eclipse,
IntelliJ IDEA, or Sun ONE Studio, compile and run a
simple program to confirm that the IDE knows where you
installed Java, otherwise do proper setup as given
document of the IDE.