Comment basculer entre JDK 7 et JDK 8
Cherchons le package avec la commande.
$ yum search openjdk
Loaded plugins: priorities, update-motd, upgrade-helper
12 packages excluded due to repository priority protections
======================= N/S matched: openjdk =============
java-1.6.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.6.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.6.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.6.0-openjdk-javadoc.x86_64 : OpenJDK API Documentation
java-1.6.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.7.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.7.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.7.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.7.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.7.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.8.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.8.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.8.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.8.0-openjdk-headless.x86_64 : OpenJDK Runtime Environment
java-1.8.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.8.0-openjdk-javadoc-zip.noarch : OpenJDK API Documentation compressed in single archive
java-1.8.0-openjdk-src.x86_64 : OpenJDK Source Bundle
$ yum install java-1.8.0-openjdk
#
#La confirmation est terminée lorsque la version Java installée est affichée.
#
$ java --version
java version "1.8.0_141"
$ java -version
#
# output
# java version "1.7.0_151"
# ....
#
$ alternatives --config java
#
# output
#
# There are 3 programs which provide 'java'.
#
# Selection Command
# -----------------------------------------------
# *+ 1 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
# 2 /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java
# 3 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
#
# Enter to keep the current selection[+], or type selection number:
#
# input 2
$ java -version
#
# output
# openjdk version "1.8.0_141"
# ......
$ java -version
#
# output
# java version "1.8.0_141"
# ....
$ alternatives --config java
#
# output
#
# There are 3 programs which provide 'java'.
#
# Selection Command
# -----------------------------------------------
# * 1 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
# + 2 /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java
# 3 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
#
# Enter to keep the current selection[+], or type selection number:
#
# input 1
$ java -version
# output
# openjdk version "1.7.0_151"
# ......
end J'espère que cela vous sera utile pour votre travail.
Recommended Posts