I have difficulty compiling a simple helloworld test servlet with either
the Javac command in the terminal of Mac O S X 10.3.6 with Developer
Tools 1.1 and Java 1.4.1, or JCompiler from within Jedit 4.2.1:
_________
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloDolly extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
out.println("Hello Dolly");
}
}
________
The error I get is that the "package javax.servlet does not exist", which
I take as a clear hint that I need to add to my classpath. But in
JCompiler I use:
"javac -classpath jedit.jar:/System/Library/Java/:/System/Developer/Java/
:/Library/Tomcat/webapps/examples/servlets/HelloDolly:/Library/Tomcat/
webapps/examples/servlets/HelloDolly -deprecation -d /Library/Tomcat/
webapps/examples/servlets/HelloDolly /Library/Tomcat/webapps/examples/
servlets/HelloDolly/HelloDolly.java"
Servlet.jar is found in "/Developer/Java/J2EE/jakarta-servletapi-4/lib",
so shouldn't it be found with the above compile command? What am I missing?
In the Terminal I use only "javac -classpath :/Developer/Java/
HelloDolly.java", when I am in the same directory as the source file.
I also put aliases inside "Library/Java/Extensions", but I'm not sure I
know how these are utilized. Anyway, nothing improved.
Another odd symptom is that if I type "echo $CLASSPATH" I get a blank
line. echo $JAVA_HOME gives "/Library/Java/Home" as expected.
Any advice is welcome. I have read "Java Development on Mac OS X" for
hints, but this seems just to not to work as I expected and I wish Apple
could tell a more detailed story of Java on OS X.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden