linux上jar包的运行
指定目录:
#!/bin/bash source /etc/profile log() { echo `date +【%Y-%m-%d" "%H:%M:%S】` $1 } log "start 168 begain" nohup /home/data/168/program/jdk1.8.0_111/bin/java -Drun.type=loaddata -ms512m -mx1024m -jar /home/data/168/program/importFile168.jar >> /home/data/168/program/168.log 2>&1 & log "start 168 end"
加载第三方jar包:
配置:
# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export JAVA_HOME=/home/ismp/jdk1.7 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH
shell脚本:
#!/bin/bash source /etc/profile lib_path="/home/ismp/write_charge/lib" for jar in `ls $lib_path/*.jar` do CLASSPATH=$CLASSPATH":"$jar echo $CLASSPATH done /home/ismp/jdk1.7/bin/java -Xms1024m -Xmx1024m -XX:MaxPermSize=256m -classpath $CLASSPATH main.App $bill_cycle 6
作者: lost blog
出处: http://www.cnblogs.com/JAYIT/
关于作者:专注服务器端开发
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文链接 如有问题, 可邮件(sawyershaw@qq.com)咨询.