Download latest version of java
Before getting started with java you must have installed and properly configured java in your local machine. There are two things that you need to understand before downloading java.
- JDK (Java Development Kit).
- JRE (Java Runtime Environment).
JDK (Java Development Kit)
If you want to develop / test / debug Java applications in the system, you need JDK installed and configured according to your system. The JDK contains all the libraries and other things needed to develop an application in Java.
JRE (Java Runtime Environment)
On the other hand, JRE is only responsible to run/execute java application in your system. By default, JRE is installed and comes with most of the operating system.
Visit the official download page Oracles website.
- Accept the Oracle’s License agreement, in order to be able to download the JDK.
- Find and click on the version that corresponds to your machine’s architecture, either 32-bit or 64-bit.
- In the appearing dialog box, click on Save, in order to download the file to your local system.
Run the installer
Once the installer setup is downloaded simply run it and follow the instructions to install it properly.
Setting up the local environment
It’s time to setup installed Java on our system to make the development process easier. You can execute Java applications normally without setting the PATH environment variable. But in this case, every time you need to specify the complete path to the java executable like – (javac.exe, java.exe, javadoc.exe, etc).
Windows Operating System
On Windows OS default installation directory is C:\Program Files\Java if you haven’t, change it while installation. You have to add C:\Program Files\Java\jdk.x.x\bin (Binary) directory path to windows environment path.
- Right-click on the ‘Computer’ icon and select ‘Properties’.
- A new window will appear, from left sidebar, panel select ‘Advanced system settings’.
- Again new dialog window will be open with the title ‘System Properties’.
- Select the ‘Advanced’ tab if not selected, and click on ‘Environment Variables…’
- New Windows will appear with the title ‘Environment Variables’.
- From the ‘System Variables’ section scroll and select ‘PATH’ and click on Edit button.
- Now, add the path of Java executables (C:\Program Files\Java\jdk1.x.x).
- Click on the Ok button, and close all the windows.