Open GoogleCodeExporter opened 9 years ago
Thank you very much for reporting this issue and for providing a possible fix.
I currently do not have the possibility to test against OS X so I have to rely
on the community.
If you agree, I'll include your fix into the next release of jvmtop.
Original comment by patric.r...@gmail.com
on 12 Sep 2013 at 12:53
Sounds good to me! I tested and am using the updated .sh on my Mac. Pretty
neat tool btw.
Original comment by hughes.m...@gmail.com
on 13 Sep 2013 at 2:40
Additionally to this, JAVA_HOME detection in OS X is done with java_home.
See
http://www.mkyong.com/java/how-to-set-java_home-environment-variable-on-mac-os-x
/ for example.
I've added similar changes to the JAVA_HOME detection in the jvm_top shell
script and it fixes it on my OS 10.9 Mavericks Mac.
if [ -z "$JAVA_HOME" ] ; then
if [ `uname` == 'Darwin' ] ; then
JAVA_HOME=$(/usr/libexec/java_home)
else
JAVA_HOME=`readlink -f \`which java 2>/dev/null\` 2>/dev/null | \
sed 's/\/bin\/java//'`
fi
fi
Original comment by mark.j.f...@gmail.com
on 13 Nov 2013 at 4:45
Just to add, i'm using latest homebrew version:
$ brew info jvmtop
jvmtop: stable 0.8.0
https://code.google.com/p/jvmtop/
/usr/local/Cellar/jvmtop/0.8.0 (5 files, 116K) *
Built from source
From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/jvmtop.rb
Original comment by mark.j.f...@gmail.com
on 13 Nov 2013 at 4:47
Mark, thanks for the update!
Two questions:
1. Do you have a clue why
JAVA_HOME=`readlink -f \`which java 2>/dev/null\` 2>/dev/null | \
sed 's/\/bin\/java//'
does not work on your OS X?
- According to comment #2, it works on at least one mac system
- even if the environment variable is named java_home, it should work
nevertheless, because JAVA_HOME is set using the readlink autodection (see
above) and only read afterwards
2. Regarding your suggestion: Will the path /usr/libexec/java_home work on
every OX X system / JDK installation? If not - how should a safe OS X
autodection of this path look like?
Original comment by patric.r...@gmail.com
on 13 Nov 2013 at 7:44
Maybe it's a different OS X version - for me, on Mavericks, the $JAVA_HOME
should always be /Library/Java/Home. So by adding:
if [ `uname` = Darwin ]; then
JAVA_HOME=/Library/Java/Home
fi
to the beginning of the shell script should always work.
Original comment by xuhdev
on 30 Nov 2013 at 7:46
Plus, skip the tools.jar code for OS X.
Original comment by xuhdev
on 30 Nov 2013 at 7:48
@xuhdev:
Thanks for the information.
I am wondering that tools.jar does not exist for OS X. jvmtop needs some
classes within this jar - are they part of another jar?
Original comment by patric.r...@gmail.com
on 19 Aug 2014 at 8:25
Original issue reported on code.google.com by
hughes.m...@gmail.com
on 10 Sep 2013 at 11:51