readlink - determine actual location of the file JAVA_HOME

$readlink /usr/bin/javac
/etc/alternatives/javac

$ ls -lart /usr/bin/javac
lrwxrwxrwx 1 root root 23 May  9 13:57 /usr/bin/javac -> /etc/alternatives/javac

ls -lart /etc/alternatives/javac
lrwxrwxrwx 1 root root 42 May  9 13:57 /etc/alternatives/javac -> /usr/lib/jvm/java-7-openjdk-i386/bin/javac

$ readlink /etc/alternatives/javac
/usr/lib/jvm/java-7-openjdk-i386/bin/javac

for Maven:
export JAVA_HOME=$(/usr/libexec/java_home)

Comments

Popular posts from this blog

HAproxy logging

teamcity Automatic Agent Start under Linux

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all