Reputation: 17876
I have java sdk 1.7. I've always used django/python for web development, this will be the first time I use java.
When I tried:
import javax.servlet.http.*;
servlet is not found? How do I properly install this servlet jar?
EDIT:
I am developing some small stuff for google app engine using java.
Upvotes: 1
Views: 5815
Reputation: 121881
"javax.servlet.*" and friends come with whatever servlet container you're using. Tomcat uses j2ee.jar or servlet.jar (IIRC), WebSphere uses a different .jar, etc.
You're using Google App Engine.
That means you need to use the Google .jar files.
Here's the documentation:
https://developers.google.com/appengine/docs/java/runtime
App Engine knows to use the Java runtime environment for your application when you use the AppCfg tool from the Java SDK to upload the app.
There is only one version of the App Engine Java API. This API is represented by the appengine-api-*.jar included with the SDK (where * represents the version of the API and the SDK). You select the version of the API your application uses by including this JAR in the application's WEB-INF/lib/ directory. If a new version of the Java runtime environment is released that introduces changes that are not compatible with existing apps, that environment will have a new version number. Your application will continue to use the previous version until you replace the JAR with the new version (from a newer SDK) and re-upload the app.
Upvotes: 1
Reputation: 2641
If your IDE is Intellij you'll have to get the Ultimate version.
Below are the features of Intellij IDEA ultimate edition.
Then you can easily start a Intellij J2EE project which will include all the necessary jars in the classpath. Hope this helps.
Upvotes: 1
Reputation: 2190
it doesnt come with disttribution of core J2Se distibution ..because this API depends on which server(tomcat, jetty) you are using . so it comes with the server . If you are using tomcat its there in tomcat lib directry witth name of servler-api.jar . add it to your classpath
Upvotes: 1
Reputation: 240996
It doesn't come with standard JDK, you need to add the servlet-api.jar in your classpath
Upvotes: 2