Saturday, July 15, 2017

How-to: Setup Java JDK on Windows for Development Purposes

Most of the posts I make here will have a Java component. With that in mind, it makes sense that there be some information about making sure that is installed an configured correctly. You can always go direct to the source, but since you are here, I've included the basics.

If you are going to be doing development on a Windows computer, these are the basic steps you need to complete to ease you along:
  1. Download the JDK needed
  2. Install the JDK
  3. Set the JAVA_HOME environment variable
  4. Add the JDK's /bin folder to the PATH environment variable

Download the JDK

On this page there is a lot of good information that can help you determine what to do next. Sometimes all of that info is too much info. In this case, we are going to install JDK 8. 
  1. Navigate to Oracle's Java Downloads page
  2. Click the Java icon for Java Platform (JDK) 8uXXX 
  3. Check the radio button to 'Accept the License Agreement' in the middle of the page
  4. Click on the JDK you want to download (Windows x86 or x64), in this case, jdk-8u131-windows-x64.exe

Install the JDK

  1. Once the .exe installer is downloaded, run it
  2. Unless you have a compelling reason, it is easiest to stick with the default install path
  3. Select the default selections, unless you know why you need to make changes

Set the JAVA_HOME Environment Variable

  1. Get the path to the JDK root folder

  2. Navigate to the environment variables. In Windows 10, right-click Start icon and select System and then choose Advanced System Settings



    ~or~

    left-click Start and start typing 'Environment' until Edit the System Environment Variables appears as an option. Select that option


  3. Create and set the environment variable.
    Variable Name: JAVA_HOME
    Variable Value: C:\Program Files\Java\jdk1.8.0_131

  4. Click OK two times to save the changes

Add JDK /bin folder to the PATH

  1. To add the /bin folder to the PATH variable, select it from the same dialogue box from where you created the JAVA_HOME variable
  2. Select the PATH variable and click Edit...
  3. Add the same path used in the JAVA_HOME variable, but add the subfolder /bin to the end of that path. Your new value should be something like this:

    C:\Program Files\Java\jdk1.8.0_131\bin

No comments:

Post a Comment