简体   繁体   中英

different jdk versions returned when requesting system

i wanna understang why these three commands not always return the same jdk. In the third request, the jdk is not the same.

1- when i launch this command

java -XshowSettings:properties -version 2>&1 > /dev/null | grep 'java.home'

it returns to me

java.home usrlibjvmjava-11-openjdk-amd64

2- when i launch this

cd /etc/alternatives/java
ls -l | grep "java ->"    

it returns the same jdk

java -> /usr/lib/jvm/java-11-openjdk-amd64/bin/java

3-but in this third case :

echo $JAVA_HOME

it returns an another jdk

/usr/lib/jvm/java-1.11.0-openjdk-amd64

someone could explain why ?

i resolved myself. I got some symbolic links in my /usr/lib/jvm

 java-1.11.0-openjdk-amd64 -> java-11-openjdk-amd64
 java-11-openjdk-amd64

so, all is well

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM