-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JAVA_HOME detection fails #103
Comments
Updated jvmtoph.sh #!/bin/sh
# jvmtop - java monitoring for the command-line
# launch script
#
# author: Markus Kolb
#
# set -x
# determine installation directory
realpath=$(readlink -f "$0")
DIR=$(dirname "${realpath}")
# Make sure, JAVA_HOME and the java executable are available
if [ ! -z "$JAVA_HOME" ] ; then
java="${JAVA_HOME}/java"
else
# try the default installed JDK (i.e.: find javac)
javac=$(readlink -f $(which javac 2>/dev/null) 2>/dev/null)
bin_dir=$(dirname "${javac}")
JAVA_HOME=$(dirname "${bin_dir}")
java="${JAVA_HOME}/bin/java"
fi
TOOLSJAR="${JAVA_HOME}/lib/tools.jar"
if [ ! -f "$TOOLSJAR" ] ; then
# some dists like CentOS use this directory layout
TOOLSJAR="${JAVA_HOME}/../lib/tools.jar"
if [ ! -f "$TOOLSJAR" ] ; then
echo "No JDK installed or JAVA_HOME='$JAVA_HOME' seems to be no JDK!" >&2
exit 1
fi
fi
"${java}" $JAVA_OPTS -cp "$DIR/jvmtop.jar:$TOOLSJAR" \
com.jvmtop.JvmTop "$@"
exit $? This should also fix #79 (The updated comment just contains fixed github syntax hilighting) |
Hi @HonoluluHenk, for what concerns
Do you think that it can be fixed via pull request #95? My only concern is about the project: there is not much activity lately. |
Oh, I see. Should we make a pull request for your version? |
Yes, be my guest :) |
jvmtop.sh does not allow symlinking,
JAVA_HOME detection does not work, even for Oracle JDK if the path does contain "bin" multiple times.
The text was updated successfully, but these errors were encountered: