标签:
在命令行模式中输入uname -a ,如下图,当界面展示i386就说明本linux系统为32版本,就在官网下载对应jdk版本,或者直接到我的网盘上下载http://pan.baidu.com/s/1cqMNd8
export JAVA_HOME=/usr/local/jdk1.6.0_27(这个文件夹的名字和你下载jdk解压后的文件夹同名) export JAVA_BIN=/usr/local/jdk1.6.0_27/bin(同上) export PATH=$PATH:$JAVA_HOME/bin export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export JAVA_HOME JAVA_BIN PATH CLASSPATH
#cd /usr/local/tomcat/bin/
#./startup.sh
#!/bin/sh if [ -z "$(ps -ef | grep tomcat | grep -v ‘grep tomcat‘ | awk -F ‘ ‘ ‘{print $2}‘| awk -F ‘ ‘ ‘{print $1}‘)" ]; then echo "the tomcat has shutdwon , I want to do others" fi if [ -n "$(ps -ef | grep tomcat | grep -v ‘grep tomcat‘ | awk -F ‘ ‘ ‘{print $2}‘| awk -F ‘ ‘ ‘{print $1}‘)" ]; then { echo "the tomcat has startp , I want to kill it"; kill -9 $(ps -ef | grep tomcat | grep -v ‘grep tomcat‘ | awk -F ‘ ‘ ‘{print $2}‘| awk -F ‘ ‘ ‘{print $1}‘) } fi
在linux中安装jdk以及tomcat并shell脚本关闭启动的进程
标签:
原文地址:http://www.cnblogs.com/xxyBlogs/p/5365115.html