Tomcat deployment, setting jdk environment, jvm memory, etc.

    A custom environment file can be specified in tomcat's catalina.sh file: setenv.sh

原文:setenv.sh in CATALINA_BASE/bin to keep your customizations separate.

 

Therefore, add this file to the bin directory to set the environment and save it as setenv.sh

 

-----------------------------------------------

#!/bin/sh

 

export JAVA_HOME=/home/wangzhirui/jdk1.7.0

export JRE_HOME=$JAVA_HOME/jre

export classpath=.:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib/rt.jar

export LD_LIBRARY_PATH=$JAVA_HOME/native/lib:$LD_LIBRARY_PATH

 

export JAVA_OPTS=" \

   -server \

   -Xms512M \

   -Xmx512M \

   -Xss512k \

   -XX:PermSize=64M \

   -XX:MaxPermSize=300M \

   -XX:+AggressiveOpts \

   -XX:+UseBiasedLocking \

   -XX:+DisableExplicitGC \

   -XX:MaxTenuringThreshold=31 \

   -XX:+UseConcMarkSweepGC \

   -XX:+UseParNewGC \

   -XX:+CMSParallelRemarkEnabled \

   -XX:+UseCMSCompactAtFullCollection \

   -XX:LargePageSizeInBytes=128m \

   -XX:+UseFastAccessorMethods \

   -XX:+UseCMSInitiatingOccupancyOnly \

   -Djava.awt.headless=true"

-----------------------------------------------

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326585692&siteId=291194637