how to find JAVA_HOME in lunux code example Example: finda java home dirname $(dirname $(readlink -f $(which javac)))