Running the JDK Installer
You must have administrator privilage to install the JDK on Microsoft Windows.To run the JDK installer:
- Start the JDK 10 installer by double-clicking the installer’s icon or file name in the download location.
- Follow the instructions provided by the Installation wizard.The JDK includes the JavaFX SDK, a private JRE, and the Java Mission Control tools suite. The installer integrates the JavaFX SDK into the JDK installation directory.
- After the installation is complete, delete the downloaded file to recover the disk space.
Installing the JDK Silently
Instead of double-clicking or opening the JDK installer, you can perform a silent, noninteractive, JDK installation by using command-line arguments.
The following table lists example installation scenarios and the commands required to perform them. The notation jdk stands for the downloaded installer file base name, such as jdk-10_windows-x64_bin.exe.
| Installation Scenario | Command |
|---|---|
| Install JDK and public JRE in silent mode. | jdk.exe /s |
| Install development tools and source code in silent mode but not the public JRE. | jdk.exe /s ADDLOCAL=”ToolsFeature,SourceFeature” |
| Install development tools, source code, and the public JRE in silent mode. | jdk.exe /s ADDLOCAL=”ToolsFeature,SourceFeature,PublicjreFeature” |
Install the public JRE in the specified directory C:\test in silent mode. | jdk.exe /s /INSTALLDIRPUBJRE=C:\test |
Setting the PATH Environment Variable
It is useful to set the PATH variable permanently for JDK 10 so that it is persistent after rebooting.
Note:
The PATH variable is set automatically for the JRE. This topic only applies to the JDK.
If you do not set the PATH variable, then you must specify the full path to the executable file every time that you run it. For example:
C:\> "C:\Program Files\Java\jdk-10\bin\javac" MyClass.java
To set the PATH variable permanently, add the full path of the jdk-10\bin directory to the PATH variable. Typically, the full path is:
C:\Program Files\Java\jdk-10\bin
To set the PATH variable on Microsoft Windows:
- Select Control Panel and then System.
- Click Advanced and then Environment Variables.
- Add the location of the
binfolder of the JDK installation to thePATHvariable in System Variables.Note:ThePATHenvironment variable is a series of directories separated by semicolons (;) and is not case-sensitive. Microsoft Windows looks for programs in thePATHdirectories in order, from left to right.You should only have onebindirectory for a JDK in the path at a time. Those following the first instance are ignored.If you are not sure where to add the JDK path, append it.The new path takes effect in each new command window that you open after setting thePATHvariable.The following is a typical value for thePATHvariable:C:\WINDOWS\system32;C:\WINDOWS;”C:\Program Files\Java\jdk-10\bin”
Kindly leave a comment below in case of any challenges and i will be glad to aid you out as soon as possible.
