|
|
我的etc/profile文件是这样配置的,但编译servlet时出错
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
CATALINA_BASE=/root/apache-tomcat-6.0.2
CATALINA_HOME=/root/apache-tomcat-6.0.2
PATH=$PATH CATALINA_HOME/bin
export CATALINA_BASE CATALINA_HOME PATH
if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"
fi
if [ "$PS1" ]; then
if [ "$BASH" ]; then
PS1='\u@\h:\w\$ '
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
export PATH
PATH=$PATH:/root/jdk1.5/jre/bin:/root/jdk1.5/bin
Java_HOME=/root/jdk1.5
export Java_HOME
JRE_HOME=/root/jdk1.5/jre
export JRE_HOME
CLASSPATH=/root/jdk1.5/lib:/root/jdk1.5/jre/lib:/root/apache-tomcat-6.0.2/lib
export CLASSPATH
umask 022
------------------------------------------------------------
出错提示:
---------------------------------------------------------
:~/apache-tomcat-6.0.2/webapps/sbd/manage_sys# javac LoginSys.java LoginSys.java:6: 软件包 javax.servlet 不存在
import javax.servlet.ServletException;
^
LoginSys.java:7: 软件包 javax.servlet.http 不存在
import javax.servlet.http.HttpServlet;
^
LoginSys.java:8: 软件包 javax.servlet.http 不存在
import javax.servlet.http.HttpServletRequest;
^
LoginSys.java:9: 软件包 javax.servlet.http 不存在
import javax.servlet.http.HttpServletResponse;
^
LoginSys.java:11: 找不到符号
符号: 类 HttpServlet
public class LoginSys extends HttpServlet {
^
LoginSys.java:38: 找不到符号
符号: 类 HttpServletRequest
位置: 类 sbd.LoginSys
public void doGet(HttpServletRequest request, HttpServletResponse response)
^
LoginSys.java:38: 找不到符号
符号: 类 HttpServletResponse
位置: 类 sbd.LoginSys
public void doGet(HttpServletRequest request, HttpServletResponse response)
^
LoginSys.java:39: 找不到符号
符号: 类 ServletException
位置: 类 sbd.LoginSys
throws ServletException, IOException {
^
LoginSys.java:67: 找不到符号
符号: 类 HttpServletRequest
位置: 类 sbd.LoginSys
public void doPost(HttpServletRequest request, HttpServletResponse response)
^
LoginSys.java:67: 找不到符号
符号: 类 HttpServletResponse
位置: 类 sbd.LoginSys
public void doPost(HttpServletRequest request, HttpServletResponse response)
^
LoginSys.java:68: 找不到符号
符号: 类 ServletException
位置: 类 sbd.LoginSys
throws ServletException, IOException {
^
LoginSys.java:91: 找不到符号
符号: 类 ServletException
位置: 类 sbd.LoginSys
public void init() throws ServletException {
^
LoginSys.java:24: 找不到符号
符号: 变量 super
位置: 类 sbd.LoginSys
super.destroy(); // Just puts "destroy" string in log
^
LoginSys.java:49: 找不到符号
符号: 方法 getClass()
位置: 类 sbd.LoginSys
out.print(this.getClass());
^
LoginSys.java:78: 找不到符号
符号: 方法 getClass()
位置: 类 sbd.LoginSys
out.print(this.getClass());
^
15 错误 |
|