lundi 13 juin 2016

What are the difference between the java executable located in all these locations?

Until now, I've been thinking setting environment variable is just setting the path for the executable so that the system can find them to execute the corresponding executable. But with Java in MacOS, I've been seeing so many suggestions and locations of jre and jdk that I am getting really confused. Can you explain the difference between the following locations of JAVA.

* /usr/bin/java // This is the output of my 'which java'

* /usr/bin/java // The output of my 'whereis java'

* $JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home - what is the difference between the Java here and the the link above

* /usr/libexec/java_home - This gives java_home does not exist.What does this actually do?

* ls -al /usr/libexec | grep java gives this.
  lrwxr-xr-x    1 root  wheel       79 Mar 17 12:25 java_home -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home 
  The link above does not actually exist. This is the actual path that is existing /System/Library/Frameworks/JavaVM.framework/Versions/Current/Home/bin

* echo $PATH gives 
  /usr/local/opt/pyenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/bin

Can anyone explain the differences between all these java executables? or let me know if there is any error in setting the path.

Aucun commentaire:

Enregistrer un commentaire