Java Tutorial 1 – Setting up Java Environment on Windows
If you are new to Java then this is the first step you need to perform. Until unless your Java environment is setup properly, you will not be able to develop java programs and run them successfully.
Step 1:
Download JDK from Oracle’s website based on your operating system.
If you are on Windows OS, download exe files based on your version i.e either 32-bit or 64-bit. If it’s 32-bit download Windows x86 exe file else download Windows x64 exe file. If you are not sure of your Windows version, you can easily check it in Display Proerties>Settings>Color Quality.
If you are on Unix or any other unix based flavor OS, you should download Self Extracting Installer to install it with ease.
Step 2:
Install the downloaded JDK executable file, it’s very straight forward and installs JDK and JRE into Program Files folder.
Quick Tip: JDK is required for development of Java projects, if you just have to run java applications, you can work with JRE only.
Step 3:
After installing JDK, you need to setup two environment variables to get it working.
Go to System Properties(Right Click on My Computer and select Properties)>Advanced>Environment Variables
In the popup window, System variables section, click on New button and add a variable with following details:
Name: JAVA_HOME
Value: C:\Program Files\Java\jdk1.6.0_25
After this, you need to edit the Path variable already present there. Just select Path variable and click on Edit button. In the popup window value section, go to the end and add following “;C:\Program Files\Java\jdk1.6.0_25\bin” (The colon ; is used as delimiter, so don’t miss that!)
Now your setup is done and you can check it by opening a command prompt and running command “java – version”.
Step 4: Optional
If you want to get things done easily, you should install either Eclipse of NetBeans IDE that helps a lot in development. Just download and install it with executable file.
Let me know if you face any issue in setting up the environment.
