On Amazon Linux:
1 2 |
## Amazon Linux sudo amazon-linux-extras install java-openjdk11 -y |
On RHEL/CentOS:
1 2 |
## RHEL/CentOS sudo yum -y install java-11-openjdk java-11-openjdk-devel |
On Debian/Ubuntu:
1 2 |
## Debian/Ubuntu sudo apt-get install openjdk-11-jdk |
On Fedora:
1 2 |
## Fedora sudo dnf install java-11-openjdk |
On Windows:
1 2 3 4 5 |
## Windows ## Open a command propmt as admin and execute below command @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" ## install jdk choco install jdk11 |
Once installed, check the java version to confirm if the installation was successful.
1 2 |
## Java version java --version |