How to Install Java (JDK)? Java Development Environment

You will need a Java development environment (JDK) to write Java programs. You can download the Sun Microsystems JDK from the Java website.

Installing the JDK – Java Development Environment

Run the Setup application to put the JDK or the sample files on Windows. The package installs in C:\Program Files\Java\jdk1.8.0_112, but you can choose a different location. You will be able to choose whether or not to install the JDK, the example files, and other supplementary files. You will install those items if you select the desired options.

On the Macintosh, double-click the installation software to install the JDK or the sample files. By default, the package will install in the Java folder on your hard drive, but you have the option to place it elsewhere.

Set JAVA_HOME:

There are two ways to set the Java path

Temporary Way of Setting Java Path

Open cmd
Write in cmd:
javac

If you don’t have Java installed, the following message will appear:

Javac is not a command that can be run from the command line, an internal or external program, or a batch file.
Write in cmd: set path=C:\Program Files\Java\jdk1.8.0_121\bin
Write in cmd:
 javac

You can check that the path is set if no error has been raised.

Permanent of Setting Java Path

Right-click on “My computer” and click on properties
Click on “Advanced system settings.”
Click on “Environment variables.”
Click on the new tab of the user variable
Write path in a variable name
Click OK

Java Development Environment

On the Advanced tab, select Environment Variables and then edit 

JAVA_HOME: C:\Program Files\Java\jdk1.8.0_112
JDK_HOME: %JAVA_HOME%
JRE_HOME: %JAVA_HOME%\jre
CLASSPATH: .;%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib

Checking Java Version (java -version)

To check the Java version, you must add the path to environment variables, which you can find in the Control Panel. Open the JDK installation folder and add the path up to the /bin directory in the environment variables. Then, add the path variable to System Variables, which resides in Environment Variables.

java -version 

This command will display the current version of Java that is installed on your machine.

To get your JDK location in Windows, run this at a command prompt:

where java

Installing Eclipse

Download Eclipse from the website.
To run the file you got from the Eclipse website, click on it. Run the Eclipse Installer program. When you start this file, you could see a warning about security. You can click Run if the Eclipse Foundation is the Publisher.
The Eclipse Installer shows Eclipse users the packages they can use. You can either search for the package you wish to install or navigate through the list.
Choose the folder where you want Eclipse to be installed. Your User folder will be the default folder. To start the installation, click the “Install” button. “Start Eclipse.”

Scroll to Top
Verified by MonsterInsights