J2EE Environment Setup
JDK 11
Downloading and installing Java is easy and free. Download latest version of JDK from the Java website www.java.com and install it from an executable file.
By default, JDK is installed in “C:\Program Files\Java\jdk11.x.xx” folder in the windows environment. This folder has subfolder .\bin that has javac.exe to compile a java program and java.exe to execute a java class.
You can verify your java installation by executing the following command.
C:\>java –version
If you get the following output text then congratulations your java has been successfully installed.
java version "11.x"
Troubleshooting
If java –version command does not work then check environment variable PATH. It should contain java executable folder “C:\Program Files\Java\jdk11.x\bin”.
If path does not contain JDK executable folder then edit PATH and append it by following command.
SET PATH = %PATH%; C:\Program Files\Java\jdk11.x\bin
Set JAVA_HOME
Many JAVA Servers ( TOMCAT, JBoss ) and Java Tools use the JAVA_HOME environment variable to locate java.exe to execute class files. It is advisable for you to set JAVA_HOME environment variable to execute java based servers and tools.
JAVA_HOME contains the installation path of JAVA.
Set environment variable JAVA_HOME to installation path C:\Program Files\java\ jdk-11.x using following steps
Right Click on My Computer->Properties-> Advanced->Environment Variables ->User Variables -> New
Set JAVA_HOME to value C:\Program Files\java\ jdk-11.x
Set PATH
In order to run Java from a command prompt, you need to set JAVA_HOME\bin folder in PATH environment variable.
Use the following command at Command Prompt to set PATH.
Set PATH environment variable to %PATH%;%JAVA_HOME%\bin.
Or you can set it from the Environment Variable popup window.
See Video