LINUX服务器上,startClass.sh脚本,内容配置如下,需要修改几项,则可以调用JAR包文件。(最简版)

 

#!/bin/sh
###JDK必须重新填写
if [ "$JAVA_HOME" = "" ]; then
 JAVA_HOME="/usr/local/java/jdk1.6.0_21"
fi

 

JAVACMD="$JAVA_HOME/bin/java"
JAVADBG="$JAVA_HOME/bin/java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=11001,server=y,suspend=n"
CLASS_HOME=""
###主类必须重新填写
SERVICE_CLASS="com.gas.test.requestgis.GisRequest"


LC_ALL=zh_CN.GB18030
export LC_ALL

oldCP=$CLASSPATH
###JAR包位置必须重新填写
unset CLASSPATH
for i in /usr/local/gas/gASHome/projects/wlva/modules/requestgis/* ; do
  if [ "$CLASSPATH" != "" ]; then
    CLASSPATH=${CLASSPATH}:$i
  else
    CLASSPATH=$i
  fi
done

 

if [ "$CLASS_HOME" != "" ]; then
  for i in ${CLASS_HOME}/* ; do
    if [ "$CLASSPATH" != "" ]; then
      CLASSPATH=${CLASSPATH}:$i
    else
      CLASSPATH=$i
    fi
  done
fi

if [ "$oldCP" != "" ]; then
    CLASSPATH=${CLASSPATH}:${oldCP}
fi

${JAVACMD} -cp $CLASSPATH ${SERVICE_CLASS}

exit 0


GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐