johnson@pc:~$sudo gedit /etc/profile
#set java environment
JAVA_HOME=/usr/java/jdk1.6.0_21
export JRE_HOME=/usr/java/jdk1.6.0_21/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
--------------------------------------
johnson@pc:~$sudo gedit /home/johnson/.bashrc
#set java environment
export JAVA_HOME=/usr/java/jdk1.6.0_21
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOMR/bin
-----------------------------------------
johnson@pc:~$sudo gedit /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
CLASSPATH=/usr/java/jdk1.6.0_21/lib
JAVA_HOME=/usr/java/jdk1.6.0_21
----------------------------------------
johnson@pc:~$sudo gedit /opt/tomcat/conf/tomcat-users.xml
在</tomcat-users>的标签前添加一行
<user username="用户名" password="密码" roles="admin,manager"/>
http://wiki.ubuntu.org.cn/%E4%BD%BF%E7%94%A8Tomcat%E8%AE%BE%E7%BD%AEJSP%E7%8E%AF%E5%A2%83