2. How to Install OpenJDK in Windows using Chocolatey?

You can also install java in your windows system from OpenJDK. Following are the steps to install java in windows, software required for installation is chocolaty.


Step 1:
Search for window PowerShell and run it as administrator. And copy-paste the following command and press enter.

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

Once chocolaty is installed successfully you will get the following message. Chocolatey (choco.exe) is now ready.
You can call choco from anywhere, command line, or PowerShell by typing choco.

Now you are ready to install java using chocolaty.
Not only java we can install different applications using chocolaty commands.

Java C2_ Set-up
Set-up of Java

Step 2:
To install Java SE, run the following command from PowerShell.

choco install jdk8
Java C2_ Set-up

It will ask for confirmation as shown in the above image selected part. Type Y and enter.
It will show the message like Downloading JDK from… as shown in the above image. If a download is not started automatically press enter key to start the download.

On successful JDK download, you will get the following messages on the PowerShell window.

Java C2_ Set-up

Step 3:
Chocolaty automatically sets the JDK path in an environment variable. If the java path is not set automatically then we can also set it manually from editing system environment variables.

-A blog by Shwetali Khambe

Related Posts