how to print java home path in linux code example Example: finda java home dirname $(dirname $(readlink -f $(which javac)))