Solved

Java compilation error

Posted on 2002-03-31
5
185 Views
Last Modified: 2013-11-24
Hi

I compiled a java program using javax.servlet & it has
error as below :-

Pls help me what is the problem & what need to do
to solve the problem.
I'm using jdk1.3.1 & Apache Tomcat 4.0.1.

Thanks
Heng03

Compiling C:\Java_Project_2\WEB-INF\classes\CheckUser.java
C:\Java_Project_2\WEB-INF\classes\CheckUser.java:8: package javax.servlet does not exist
import javax.servlet.*;
^
C:\Java_Project_2\WEB-INF\classes\CheckUser.java:9: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
C:\Java_Project_2\WEB-INF\classes\CheckUser.java:11: cannot resolve symbol
symbol  : class HttpServlet  
location: class CheckUser
public class CheckUser extends HttpServlet {
                               ^
C:\Java_Project_2\WEB-INF\classes\CheckUser.java:17: cannot resolve symbol
symbol  : class ServletConfig  
location: class CheckUser
     public void init(ServletConfig config) throws ServletException {
0
Comment
Question by:heng03
  • 3
5 Comments
 
LVL 3

Accepted Solution

by:
msterjev earned 100 total points
ID: 6908584
Just put servlet.jar in some place where javac cant find it. The best way is to put it like an extension.For example if Java is installed into the C:\jdk1.3.1 then put the servlet.jar into the:

C:\jdk1.3.1\jre\lib\ext

Enjoy.
0
 
LVL 3

Expert Comment

by:msterjev
ID: 6908828
The points,please!
0
 
LVL 92

Expert Comment

by:objects
ID: 6909542
You need to install java 2 enterprise edition (j2ee):
http://java.sun.com/j2ee/download.html

The standard edition does not include support for servlets.
0
 
LVL 3

Expert Comment

by:msterjev
ID: 6909715
No you did not. servlet.jar is included with the tomcat. You put servlet.jar (take it from the tomcat lib directory and put it to be an extension, or adjust yours system classpath to point to the current servlet.jar path)
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6912978
Greetings all.

msterjev, can you please confirm for me that you did receive these points?  I want to ensure there wasn't some sort of database problem, since points weren't deducted, per this information; before taking corrective action.
http://www.experts-exchange.com/questions/Q.20283650.html
Thanks,
Moondancer - EE Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
json example 39 135
Unexpected HttpURLConnection connection behavior 2 86
Responding to Java JComponent extended classes's resize event 4 52
table example 4 24
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now