• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

compiling servlets

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've download J2SE 6u 1 to compile servlets using Eclipse 3.3, import javax.servlet.*; error... can not be resolved... Can someone help with which java compiler to using for compiling servlets & JSP

Thanks!
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your compiler is fine. What you need is a library called servlet-api.jar. If you have installed Tomcat, it's in the common/lib directory. Go to the settings of your Eclipse project, and set this library in the Java build path.
 
Delano Pagee
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Done... but nothing happened... I checked the java build path for the project after adding the api-servlet jar... source attachment NONE... I think it the complete javax.servlet classes are missing from the JDK 6 u1... I checked the source code for JDK 6 u1 and their not there either... what do ya think?
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Delano Pagee:
Done... but nothing happened... I checked the java build path for the project after adding the api-servlet jar... source attachment NONE... I think it the complete javax.servlet classes are missing from the JDK 6 u1... I checked the source code for JDK 6 u1 and their not there either... what do ya think?



That's right. They are not part of the JDK. They are part of the Java Enterprise Edition (JEE). As Satou pointed out, the easiest thing to do is grab the servlet-api.jar and place it in your classpath. In Eclipse, it's as Satou said.

What do you mean by "but nothing happened" and "...NONE..."?
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With all due respect, I'm gonna slide this over to the servlets forum.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This gets asked a lot here so we have a FAQ entry on compiling servlets.
http://faq.javaranch.com/view?CompilingServlets

If you're unfamiliar with setting your classpath, let me know and I'll move this thread to our Java In General (Beginner) forum where javac and classpath issues are best discussed.

If you're having trouble getting a particular IDE to pickup servlet-api.jar, then also let me know. We have a forum for IDEs where configuration issues are covered.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic