Gossamer Forum
Home : General : Internet Technologies :

Jikes/Tomcat/Servlets

Quote Reply
Jikes/Tomcat/Servlets
jikes cannot compile the .java files for servlets. the details of error:

jikes -classpath /usr/local/tomcat/lib/servlet.jar SessionExample.java


Found 2 system errors and issued 1 warning:

*** Error: Could not find package named:
/usr/local/tomcat/lib/servlet.jar(java/util)


*** Warning: The file "/usr/local/tomcat/lib/servlet.jar" is not a valid zip file.


*** Error: Could not find package named:
/usr/local/tomcat/lib/servlet.jar(java/lang)

---------

jikes -classpath /usr/java/jre1.3/lib/rt.jar:/usr/local/tomcat/lib/servlet.jar SessionExample.java

Issued 1 system warning:

*** Warning: The file "/usr/local/tomcat/lib/servlet.jar" is not a valid zip file.

Found 7 semantic errors compiling "SessionExample.java":

3. import javax.servlet.*;
<----------->
*** Error: Could not find package named:
/usr/java/jre1.3/lib/rt.jar(javax/servlet) or
/usr/local/tomcat/lib/servlet.jar(javax/servlet)


4. import javax.servlet.http.*;
<---------------->
*** Error: Could not find package named:
/usr/java/jre1.3/lib/rt.jar(javax/servlet/http) or
/usr/local/tomcat/lib/servlet.jar(javax/servlet/http)


6. public class SessionExample extends HttpServlet {
<--------->
*** Error: Type HttpServlet was not found.


8. public void doGet(HttpServletRequest request, HttpServletResponse response)
<---------------->
*** Error: Type HttpServletRequest was not found.


8. public void doGet(HttpServletRequest request, HttpServletResponse response)
<----------------->
*** Error: Type HttpServletResponse was not found.


9. throws IOException, ServletException
<-------------->
*** Error: Type ServletException was not found.


14. HttpSession session = request.getSession(true);
<--------->
*** Error: Type HttpSession was not found.

-------------

What could these be due to and how to get rid of these errors to compile .java files using jikes.

Thnx

Anup

Anup
Quote Reply
Re: [anup123] Jikes/Tomcat/Servlets In reply to
It was the permissions. The tomcat directory was not set world readable (do not know why?) and certain jar files were also not world readable.

changed the directory permission to 751 and jar files to 644 and now a non root user can compile.

Just do not know why the permissions (750) were set that way by the service provider on the tomcat directory. Any comments and i hope it is safe to put it to 751.

Smile

Anup