To start building java programs on any system you need to install “JDK”. JDK stands for “Java Development Kit”. JDK has built in class, methods, defitions etc. Without JDK our program is normal Text file. JDK provide tool to compile and execution.
Where to download JDK :
- Search “JDK download” on google, or goto this link.
- On this link there are multiple versions of JDK available for multiple platforms.
- Choose latest version and accept liecence by clicking on toggle button on top.
- And download according to your operating system. (also check if you have 64bit operating system then download 64bit version of JDK, else download 32bit)
How to install JDK ???
for windows :
- Download windows executable file of JDK 64bit or 32bit according to your system.
- After downloading install it as normal app, it will also install “JRE” (Java Runtime Environment).
- When installation finish “Right Click on My Computer icon” and choose “Properties”.
- From left options click on “Advance system settings”.
- Now click on “Environment Variables” button at bottom.
- Now there will be 2 parts “User variables” and “System Variables”.
- Under “User variable” click on “New…” button.
- Enter variable name “path” and variable value to actual path where jdk is installed. in my system it is like this : “C:\Program Files\Java\jdk1.8.0_91\bin”.
- Click “ok” and again “ok” to close opened windows.
- Now JDK is successfully install on your windows System.
Install JDK on Linux System :
- After downloading jdk package “it will be in tar.gz format”
now open terminal and type below commands 1 by 1.
- After installation is complete, set environment variables as follows.
Edit the system path in file /etc/profile: Add the following lines at the end.
Install JDK on MAC OSX:
- After downloading .dmg file from link above.
- Install as normal app.
- when installation finish we need to add java installed location to “Java path”. read here how to add java path.