java + eclipse + apple snow: missing javax.servlet.*
I'm trying to write a simple java applet program, but it seems that I'm missing the javax.servlet.*
class definitions.
Using:开发者_运维知识库
- apple snow
- eclipse Java EE ide
Do I need to add a specific JAR file to my project and if so, which one?
I have Macports installed in case something from the ports might be helpful.
This is all result of misconceptions (Applets have nothing to do with the actual problem) and ignorance about Eclipse (if offers builtin ways to seamlessly integrate and link the one and the other, the Java EE variant has already a Tomcat plugin, you just have to integrate the server and associate it with the web project).
In the future you should be more precise and detailed about the problem (and thus not telling like "...it seems that..."). Post the relevant code snippet which caused the problem. Post the actual error message (with stacktrace, if any). Post the steps to accomplish to reproduce the problem. Also see: How To Ask Questions The Smart Way.
I've answered several times before how to get started with Eclipse+Tomcat+Servlets, you may find it useful as well:
- Question about installing Java EE locally?
- Tomcat servlet problem - class not found
- CLASSPATH, Java Buld Path (eclipse), and WEB-INF\LIB : what to use, when, and why?
Thank for all of your helpful comments. I installed tomcat 6 and it contains the missing jar in order to compile the project.
Nice plug-in to load tomcat applications :
Sysdeo Eclipse Tomcat Launcher plugin - http://www.eclipsetotale.com/tomcatPlugin.html
Using Netbeans i was able to properly compile tomcat applications just by creating a new java web application. for now i'll stick to netbeans, it also has a nice gui for connecting to the server and seeing the installed applications and their status.
精彩评论