J2EE Environment Setup

JDK 1.8

  • 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\jdk1.7.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 following command. 
           C:\>java –version
  • If you get following output text then congratulations your java has been successfully installed.
          java version "1.8.x"

Troubleshooting

  • If java –version command does not work then check environment variable PATH. It should contain java executable folder “C:\Program Files\Java\jdk1.8.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\jdk1.8.x\bin

Set JAVA_HOME

Many JAVA Servers ( TOMCAT,JBoss ) and Java Tools use JAVA_HOME environment variable to locate java.exe to execute class files.  It is advisable 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-1.8.x   using following steps 
  1. Right Click on My Computer->Properties-> Advanced->Environment Variables ->User Variables -> New 
  2. Set JAVA_HOME to value C:\Program Files\java\ jdk-1.8.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 following command at Command Prompt to set PATH.

Set PATH environment variable to %PATH%;%JAVA_HOME%\bin.

Or you can set from Environment Variable popup window.



 See Video

JAVA_HOME Setup Video



Comments