java 8 - How select a given JDK in CentOS -
i want update java version in centos machine,
actually when java -version gives me :
$java -version java version "1.7.0_79" openjdk runtime environment (rhel-2.5.5.3.el6_6-x86_64 u79-b14) openjdk 64-bit server vm (build 24.79-b02, mixed mode) i'm using alternatives configure java interpreter should used :
sudo alternatives --config java it gives me :
there 3 programs provide 'java'. selection command ----------------------------------------------- * 1 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java 2 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java + 3 /usr/lib/jvm/jdk1.8.0_91/bin/java enter keep current selection[+], or type selection number: and selected number 3 (which jdk1.8.0_91)
however when redo java -version still openjdk 1.7 selected !!!
$java -version java version "1.7.0_79" openjdk runtime environment (rhel-2.5.5.3.el6_6-x86_64 u79-b14) openjdk 64-bit server vm (build 24.79-b02, mixed mode)
run these command check configuration:
$ java, result should/bin/javaor/usr/bin/java. otherwise, check environment profile (/etc/bashrc, /etc/profile, ~/.bash_profile, ~/.bashrc, etc.) , remove similarexport java_home="/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.79.x86_64/jre"declared.$ ls -al /bin/javaor$ ls -al /usr/bin/javashould point/etc/alternatives/javaor alternatives ineffective.
Comments
Post a Comment