日期:2014-05-16  浏览次数:20770 次

linux下,jdk安装脚本,tomcat安装脚本
#文件为ji.sh 运行方法:./ji.sh和jdk的gz包在同一个目录下
#!/bin/sh
tar -zxvf jdk-7u51-linux-x64.tar.gz
if [ ! -d /opt/java ]; then
mkdir -p /opt/java
fi 
mv jdk1.7.0_51  /opt/java
echo -e  "JAVA_HOME=/opt/java/jdk1.7.0_51" >> /etc/profile
echo -e  "export JAVA_HOME" >> /etc/profile
echo -e  "JAVA_BIN=/opt/java/jdk1.7.0_51/bin" >> /etc/profile
echo -e  "export JAVA_BIN" >> /etc/profile
echo -e  "PATH=$PATH:$JAVA_BIN" >> /etc/profile
echo -e  "export PATH" >> /etc/profile
echo -e  "CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar" >> /etc/profile
echo -e  "export CLASSPATH" >> /etc/profile
source /etc/profile

?

#文件为ti.sh 运行方法./ti.sh  和apache的gz包在同一个目录下
#!/bin/sh
tar -zxvf apache-tomcat-7.0.52.tar.gz
if [ ! -d /usr/local ]; then
mkdir -p /usr/local
fi 
mv apache-tomcat-7.0.52  /usr/local
echo -e  "TOMCAT_HOME=/usr/local/apache-tomcat-7.0.52" >> /etc/profile
echo -e  "export TOMCAT_HOME" >> /etc/profile

?

?