Java

Install Java 9 on Windows


This tutorial will show how to install Java 9 on Windows and set up the necessary environment variables for application development.

Download

Visit this link to download the appropriate JDK 9 for your Windows, accepting Oracle’s license agreement.

Installation

Run the downloaded installer and proceed with the installation, accepting the licence terms and advancing the installation steps to complete the process, without any additional settings as the following screenshots:

Environment Variables

Open the environment variables settings window by pressing Windows + Pause/Break or through Control Panel -> System -> Advanced system settings -> Environment Variables.

Click on New… button on System environment variables and add the three following variables.

Variable nameVariable value
JAVA_HOMEJDK installation path, example: C:\Program Files\Java\jdk-9
CLASSPATH. (just a dot)
PATHIt may already exists on your system under the name Path, so edit its value by adding at the end: %JAVA_HOME%\bin; If it not exists already, create a new one with the value %JAVA_HOME%\bin;

Validating

In order to validate the Java installation and the environment variables setup, open the Command Prompt by clicking the Start Menu and type cmd. Next, type the following commands in the prompt, which should print the version information if Java has been configured correctly.

C:\Users\Bruno>java -version
java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
C:\Users\Bruno>javac -version
javac 9

I hope it helps.
Cya!

bgasparotto

View Comments

  • I am still getting this error ' ‘javac’ is not recognized as an internal or external command, operable program or batch file.

    I updated from java8 to java9. and getting this error.

    variable name JAVA_HOME
    variable value C:\Program Files\Java\jdk-9.0.1\bin

    • Hi! Please remove the \bin from the value of your JAVA_HOME, so you will have:
      C:\Program Files\Java\jdk-9.0.1
      And make sure you set up the PATH variable as described, which already includes the \bin folder.

  • Still getting the 'javac' is not recognized as an internal or external command, operable program or batch file error

    • Hello! Have you set up the environment variables? If so, could you provide your setup so I could check, please?
      Looking forward to hear back from you.

Recent Posts

Python function decorator

This guide will show you how to create a Python function decorator with a few…

2 years ago

Got permission denied while trying to connect to the Docker daemon socket

This guide will show you how to fix the error Got permission denied while trying…

2 years ago

Python virtual environment on Intellij IDEA

This guide will show you how to create a Python virtual environment on Intellij IDEA…

2 years ago

Find and kill processes on Linux and Mac by port number

This tutorial will quickly show you how to to find and kill processes on Linux,…

2 years ago

Python: Relocation R_X86_64_PC32 against symbol can not be used when making a shared object Error

This guide shows a possible solution for Python error Relocation R_X86_64_PC32 against symbol can not…

2 years ago

Kubernetes useful commands

I condensed below a cheat sheet of Kubernetes useful commands. I will keep updating this…

2 years ago