Install JDK on CentOS using Terminal
To install JDK on CentOS , we need to follow the following steps:
1. Verify the existing java version
command:
java -version
response:
java-1.6.0-openjdk
2. Remove OpenJDK if you find.
command:
yum remove java-1.6.0-openjdk
3. Then donwload the SDK from oracle by visiting the following site
http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html
4. Go to the downloaded path , and execute the command:
command
sudo rpm -ivh jdk-8u25-linux-x64.rpm
5. Check java version now
command
java -version
response:
jdk1.8.0.151
6. Create JAVA_HOME and add it into the PATH
command
export JAVA_HOME =/ust/java/jdk1.8.0.151
export PATH= $PATH:$JAVA_HOME
7. Verify the Path
command
echo $JAVA_HOME
echo $PATH
To install JDK on CentOS , we need to follow the following steps:
1. Verify the existing java version
command:
java -version
response:
java-1.6.0-openjdk
2. Remove OpenJDK if you find.
command:
yum remove java-1.6.0-openjdk
3. Then donwload the SDK from oracle by visiting the following site
http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html
4. Go to the downloaded path , and execute the command:
command
sudo rpm -ivh jdk-8u25-linux-x64.rpm
5. Check java version now
command
java -version
response:
jdk1.8.0.151
6. Create JAVA_HOME and add it into the PATH
command
export JAVA_HOME =/ust/java/jdk1.8.0.151
export PATH= $PATH:$JAVA_HOME
7. Verify the Path
command
echo $JAVA_HOME
echo $PATH
No comments:
Post a Comment