diff --git a/pmd-dist/src/main/scripts/run.sh b/pmd-dist/src/main/scripts/run.sh index 9a5ce0d3e0..dfda65642c 100755 --- a/pmd-dist/src/main/scripts/run.sh +++ b/pmd-dist/src/main/scripts/run.sh @@ -61,7 +61,9 @@ java_heapsize_settings() { set_lib_dir() { if [ -z ${LIB_DIR} ]; then - local script_dir=$(dirname "${0}") + # Allow for symlinks to this script + local script_real_loc=$(realpath "$0") + local script_dir=$(dirname "${script_real_loc}") local cwd="${PWD}" cd "${script_dir}/../lib"