JVM-Optionen in Tomcat hinzufügen
Wie kann ich jvm-Optionen (Java Virtual Machine) in Apache Tomcat 6 hinzufügen?
Gibt es eine Verwaltungskonsole in Tomcat? Ich habe http://localhost:8080/admin ausprobiert, aber ich konnte nichts damit anfangen.
Ich möchte die folgenden jvm-Optionen hinzufügen:
-agentpath:C:\calltracer\jvmti\calltracer5.dll=traceFile-C:\calltracer\call.trace,filterFile-C:\calltracer\filters.txt,outputType-xml,usage-uncontrolled -Djava.library.path=C:\calltracer\jvmti -Dcalltracerlib=calltracer5
34
3
Wie Bhavik Shah sagt, können Sie dies in JAVA_OPTS tun, aber der empfohlene Weg (laut catalina.sh) ist es, CATALINA_OPTS zu verwenden:
Setzen Sie sie in der Variablen
JAVA_OPTS
in [Pfad zum Tomcat]/bin/catalina.sh. Unter Windows gibt es eine Konsole, in der Sie die Einstellungen vornehmen können, oder Sie verwenden die Datei catalina.bat.Dazu müssen Sie die Anwendung "tomcat6w", die Teil der Standard-Tomcat-Distribution ist, im Verzeichnis "bin" ausführen. Für Windows lautet die Vorgabe z.B. "C:\Programme\Apache Software Foundation\Tomcat 6.0\bin\tomcat6w.exe". Die Anwendung "tomcat6w" startet eine grafische Benutzeroberfläche. Wenn Sie die Registerkarte "Java" auswählen, können Sie alle Java-Optionen eingeben.
Es ist auch möglich, JVM-Optionen über die Kommandozeile an tomcat zu übergeben. Dazu müssen Sie den Befehl verwenden:
wobei "tomcatexecutable" sich auf Ihre Tomcat-Anwendung bezieht, "tomcatservicename" der von Ihnen verwendete Tomcat-Dienstname ist und "JVMoptions" Ihre JVM-Optionen sind. Zum Beispiel: