Hi,
I'm trying to compile the Servlet class in Tomcat's webappps/Email/src/Mail folder, but I'm getting compile time errors:
./Email/src/Mail/Mail.java:7: package javax.mail does not exist
import javax.servlet.http.*;
./Email/src/Mail/Mail.java:9:package javax.servlet does not exist
import javax.servlet.*;
./Email/src/Mail/Mail.java:12:cannot find symbol
symbol: class HttpServlet
public class mail extends HttpServlet{
^
./Email/src/Mail/Mail.java:14: cannot find symbol
symbol: class HttpServletRequest
location: class Mail.mail
public void doPost(HttpServletRequest request,HttpServletResponse response)
^
./Email/src/Mail/Mail.java:14: cannot find symbol
symbol: class HttpServletRequest
location: class Mail.mail
public void doPost(HttpServletRequest request,HttpServletResponse response)
^
./Email/src/Mail/Mail.java:20: cannot find symbol
symbol: class MessageReading
location: class Mail.mail
MessageReading mr=new MessageReading();
7 errors
The command which I'm using to compile the class is:
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps>javac -d ./Email/WEB-INF/classes -cp ./Email/src/Mail/. ./Email/src/Mail/mail.java
Here's the servlet class:
package Mail;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Properties;
import javax.servlet.http.*;
import javax.servlet.*;
import Mail.*;
public class mail extends HttpServlet{
public void doPost(HttpServletRequest request,HttpServletResponse response)
{
try{
MessageReading mr=new MessageReading();
}
catch (Throwable e) {
System.out.println("Connection Failed! Check output console");
e.printStackTrace();
}
}
}
It's compiling correctly, when I'm trying to compile it by using the command:
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps>javac -d ./Email/WEB-INF/classes ./Email/src/Mail/*.java
The MessageReading and mail class in Mail folder.
Could anyone please tell me why the second command worked not the first?