我有一个java工程以jar的形式在linux中运行.编写的.sh文件如下:
AGENT_PATH=/root/aaa/agent
export JAVA_HOME=/usr/java/jdk1.6.0_14
export JAVA_BIN=/usr/java/jdk1.6.0_14
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$AGENT_PATH/lib:./lib:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
echo $JAVA_HOME
java -jar $AGENT_PATH/lib/agent.jar
工程目录:/root/aaa/agent
AGENT_PATH=/root/aaa/agent
export JAVA_HOME=/usr/java/jdk1.6.0_14
export JAVA_BIN=/usr/java/jdk1.6.0_14
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$AGENT_PATH/lib:./lib:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
echo $JAVA_HOME
java -jar $AGENT_PATH/lib/agent.jar
工程目录:/root/aaa/agent