1. ?? OpenJDK
sudo apt-get install openjdk-6-jre
2. ????????
java -version
#????
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.7) (6b20-1.9.7-0ubuntu1)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)
3. ?? JAVA_HOME ????
? ~/.bashrc ???????
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
4. ????? Tomcat
wget http://apache.tradebit.com/pub/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.tar.gz
tar xvzf apache-tomcat-6.0.32.tar.gz
sudo mv apache-tomcat-6.0.32 /usr/local/tomcat
sudo chmod -R 755 /usr/local/tomcat
5. ? Tomcat ??????????
sudo nano /etc/init.d/tomcat
?????
# Tomcat server auto-start script
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
case $1 in
start)
sh /usr/local/tomcat/bin/startup.sh
;;
stop)
sh /usr/local/tomcat/bin/shutdown.sh
;;
restart)
sh /usr/local/tomcat/bin/shutdown.sh
sh /usr/local/tomcat/bin/startup.sh
;;
esac
exit 0
6. ???????
sudo chmod 755 /etc/init.d/tomcat
sudo ln -s /etc/init.d/tomcat /etc/rc1.d/K99tomcat
sudo ln -s /etc/init.d/tomcat /etc/rc2.d/S99tomcat
7. ?? Tomcat
sh /usr/local/tomcat/bin/startup.sh
?????
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar
8. ?? Tomcat
sh /usr/local/tomcat/bin/shutdown.sh
????????? sun-java-jdk ??? OpenJDK?