Installing JDK

Running the JDK Installer

You must have administrator privilage to install the JDK on Microsoft Windows.To run the JDK installer:

  1. Start the JDK 10 installer by double-clicking the installer’s icon or file name in the download location.
  2. 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.
  3. 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 ScenarioCommand
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:

  1. Select Control Panel and then System.
  2. Click Advanced and then Environment Variables.
  3. Add the location of the bin folder of the JDK installation to the PATH variable in System Variables.Note:The PATH environment variable is a series of directories separated by semicolons (;) and is not case-sensitive. Microsoft Windows looks for programs in the PATH directories in order, from left to right.You should only have one bin directory 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 the PATH variable.The following is a typical value for the PATH variable: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.

Leave a comment