Installing Java (JDK) and adding to the path on Windows 06-27-2019
Tags: , ,

Recently, it has become a little less user-friendly to install Java on Windows. Here’s how to install it and add to the path.

First, download & install Java

First, you will want to download the most recent version of the JDK from Oracle, then run the installer. Take note where the installer puts Java (should be something like c:/program files/java/jdk-12.0.01)

Add to path and create JAVA_HOME

Next you want to add Java to your path. Navigate to your system’s environment variables config (Control Panel > System and Security > System > Advanced System Settings > Environment Variables). Select Path from the list of User Variables, and then click Edit. Select New > Browse, and then nagivate to where Java was installed, click inside the jdk folder and select the folder called bin.

Now click Ok twice until you are back at the main Environment Variables window. Now, under User variables, select new. Give the variable the name JAVA_HOME and for the value, select Browse. Navigate and select the JDK folder (should look like jdk-12.0.01 for example).

Reboot and test

Your PC may require a reboot for the changes to take effect. Once you reboot, you can test to make sure you’ve configured this correctly by opening the terminal and running java -version and javac -version.