You can first check the list of available packages for Java using below command.
$ yum search java | grep 'java-'
You will get the list like above. Now depending on what is your requirement you can choose the package. If you don't see any list as above, you will need to update the REPO for java.
To install JRE you can run below command.
$ sudo yum install java-1.8.0-openjdk.x86_64
$ sudo yum install java-1.8.0-openjdk*
The above commands will ask for downloading the required dependencies, press Y and enter to continue with installation. Once installation completes it will display the dependencies installed and complete message.
Now you can verify the installation by running below command.
$ java -version
openjdk version "1.8.0_144"
OpenJDK Runtime Environment (build 1.8.0_144-b01)
OpenJDK 64-Bit Server VM (build 25.144-b01, mixed mode)
You should see the java version as shown in above output.
No comments:
Post a Comment