Last Updated on 15/11/2020
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 name | Variable value |
---|---|
JAVA_HOME | JDK installation path, example: C:\Program Files\Java\jdk-9 |
CLASSPATH | . (just a dot) |
PATH | It 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!
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 yourJAVA_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.