Setting the JAVA_HOME automatically. Posted on June 3, 2013 by admin JAVA_HOME=$(readlink -f /usr/bin/javac | sed “s:bin/javac::”)