![]() Using CATALINA_HOME: /usr/local/apache-tomcat-5.5.30 Using CATALINA_BASE: /usr/local/apache-tomcat-5.5.30 Once you have tomcat installed, the jvmstat installed, the jvmstat-env.sh set correctly and the java home set with a valid tools.jar / classes.jar you should be able to start tomcat, test jvmstat using gcutil at the command line and finally launch visualgc with some success: $. I created a symbolic link from /System/Library/Frameworks/amework/Versions/1.6.0/Home/lib/tools.jar to /System/Library/Frameworks/amework/Versions/1.6.0/Classes/classes.jar, now visualgc would finally start without the error. So, with JAVA_HOME set to /System/Library/Frameworks/amework/Versions/1.6.0/Home ![]() However, classes.jar only seemed to exist in /System/Library/Frameworks/amework/Versions/1.6.0/Classes/classes.jar Or, if you are lucky, the following may work :Įxport JAVA_HOME=/System/Library/Frameworks/amework/Home The Java home isn't to be found in /usr either, that directory just contain a /usr/bin/java symlink to the latest runtimes for Java applications on your Mac, instead I found I had to set a java home to:Įxport JAVA_HOME=/System/Library/Frameworks/amework/Versions/1.6.0/Home I am yet to establish why this should be different. Under MacOS, however, the equivalent to tools.jar is classes.jar. A little investigation shows that visualgc is indeed looking for the tools.jar on start: # check that we are dealing with a JDK, not a JRE or installed JDK Yes, this is Mac OS, and yes it does bizarrely refer to 'java.exe'. JVMSTAT_JAVA_HOME environment variable to refer to aĭirectory containing the Sun J2SE 1.5.0 JDK (not a JRE) System/Library/Frameworks/amework/Versions/1.5.0/Home If visualgc thinks you don't have a complete jdk you get the following rather helpful error: $ /usr/local/jvmstat/bin/visualgc 8650 In fact, jvmstat (more specificailly visualgc) looks for this file to determine whether you have pointed your java home at a jre or a jdk. Under most OSes, the Java JDK has a ~/lib/tools.jar that the jvmstat tools rely on. This is where I should say something about the madness of JDKs on MacOS. ![]() PATH=JVMSTAT_HOME/bin:JAVA_HOME/bin:$PATH I created a ~/jvmstat-env.sh to set required variables for jvmstat: export JAVA_HOME=/System/Library/Frameworks/amework/Versions/1.6.0/Home $ cp /Users/egg/Downloads/jvmstat-3_0.zip /usr/local I chose to put this in /usr/local/jvmstat, again, this is local site install dependent. You should now be able to run ~/bin/start_tomcat and connect to to be greeted with your tomcat installation home page. Don't forget to make them executable.įor my purposes, I created a tomcat-env.sh script that can be used to some CATALINA_OPTS, I was only really interested in changing the java min and max heap sizes for now: $ cat tomcat-env.shĬATALINA_OPTS=$CATALINA_OPTS" -Xms512m -Xmx512m" I put them in ~/bin/start_tomcat and ~/bin/stop_tomcat. Worthy of note here is that I *did not* eventually use JAVA_HOME set to /usr - more on that later.Įxport CATALINA_HOME=/usr/local/apache-tomcat-5.5.30Īs mentioned, a good place for these are in your local home directory, but this may vary depending on your environment. I used the following, fairly standard looking scripts that I placed into $HOME/bin, please note that the variables will of course vary depending on your configuration. In order to start and stop tomcat with the correct details for CATALINA_HOME etc, you'll need tomcat stop and start scripts. I downloaded apache-tomcat-5.5.30.tar.gz (there are later versions available depending on your requirements, but this is the version I will be monitoring at work) from Ĭopy the file into /usr/local and extract $ gnutar -xzvf apache-tomcat-5.5.30.tar.gzĬhange the ownership to your local user and group: $ chown -R egg:staff apache-tomcat-5.5.30 A typical, popular location is /usr/local. This really couldn't be simpler, a zipped tar file to install pretty much wherever you choose. It is Unix, afterall, so what could be so hard - right?įirst task, download and install tomcat. So, as a small exercise designed to re-familiarise myself with the foibles of tomcat, garbage collection, java command line configuration options and so on I ventured on a brief excursion into the world of tomcat, java and jvmstat on Mac OS X. Now, GC analysis and configuration of the tools required to do so is something I've not done in a number of years. Today I needed to install visualgc for tomcat on Solaris.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |