Search code examples
javalinuxversion

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 ?


Solution

  • 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