linux java sh 博客分类: linux
#! /bin/sh
if [ -z "$JAVA_HOME" ] ; then
export JAVA_HOME=/usr/local/java
fi
SCRIPT="$0"
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
# Drop everything prior to ->
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
SERVER_HOME=`dirname "$SCRIPT"`
SERVER_HOME=`cd "$SERVER_HOME" ; cd .. ; pwd`
export SERVER_HOME
LIBDIR=$SERVER_HOME/lib
CLASSPATH=${CLASSPATH}:${SERVER_HOME}/conf
for lib in ${LIBDIR}/*.jar
do
CLASSPATH=$CLASSPATH:$lib
done
java=$JAVA_HOME/bin/java
JAVA_OPTS="
-Xmx1G
-Xms1G
-XX:PermSize=128M
-XX:MaxPermSize=256M
-XX:+UseConcMarkSweepGC
-XX:+UseParNewGC
-XX:+CMSConcurrentMTEnabled
-XX:+CMSParallelRemarkEnabled
-XX:+UseCMSCompactAtFullCollection
-XX:CMSFullGCsBeforeCompaction=0
-XX:+CMSClassUnloadingEnabled
-XX:LargePageSizeInBytes=128M
-XX:+UseFastAccessorMethods
-XX:+UseCMSInitiatingOccupancyOnly
-XX:CMSInitiatingOccupancyFraction=80
-XX:SoftRefLRUPolicyMSPerMB=0
-XX:+PrintClassHistogram
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-XX:+PrintHeapAtGC
-Xloggc:/data/logs/gc.log
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=/data/logs/dump.hprof
"
echo "JAVA_HOME :$JAVA_HOME"
echo "SERVER_HOME:$SERVER_HOME"
echo "CLASSPATH :$CLASSPATH"
echo "JAVA_OPTS :$JAVA_OPTS"
cd $SERVER_HOME
exec $java -classpath $CLASSPATH $JAVA_OPTS com.XX.XX.bootstrap
推荐阅读
-
Linux系统上安装(升级)Jdk过程 博客分类: linux linuxjdkjavajava7centos
-
java7 新特性 博客分类: java知识总结 java7jdk
-
学习java7的fork/join 博客分类: java语言 java7
-
静态工厂方法VS构造器 博客分类: Effective Java java7设计模式
-
java笔记一 博客分类: java
-
linux java sh 博客分类: linux
-
Java7中的switch支持String的实现细节 博客分类: Java 基础 javajava7
-
Java访问文件属性 博客分类: bloom java7
-
CentOS 6.6安装配置supervisor进程管理工具 博客分类: linux
-
java7文件及目录变更监控 博客分类: java基础 java7基础