• 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

Errors in compiliation.

 
Ranch Hand
Posts: 86
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I created a fully functional servlet that works and then i send it to a friend he opened it in Eclipse Juno Enterprise Edition and then he get an error saying Imports Cannot Be Resolved. He has JDK7 installed JRE7 and Apache Tomcat. Wat is the issue here? Its saying that there is no class for HTTPServlet also.

The import javax.servlet cannot be resolved
The import javax.servlet cannot be resolved

Why is he getting this error?

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to beginning Java where compilation issues are discussed.

Is the servelet-api.jar in the build classpath?
 
Yuta Lolap
Ranch Hand
Posts: 86
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do i chek the class path?


Rightick the project->build path->configure build path and then i get to see all the jre7 and webapp libs. Thi is wat i can see in eclipse. I there something missing here?
 
Yuta Lolap
Ranch Hand
Posts: 86
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hw to incude the servlet api? And thanjs for moving me to the right section.
 
Ranch Hand
Posts: 859
IBM DB2 Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
javax.servlet is provided usually by the container; Tomcat,JBoss,WebSphere etc.

WP
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

William P O'Sullivan wrote:javax.servlet is provided usually by the container; Tomcat,JBoss,WebSphere etc.

WP



While those products may provide the Servlet classes, that doesn't help here since the problem is a compilation error (as indicated in the subject line and first post).
 
Ranch Hand
Posts: 930
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Download/get servelet-api.jar and put it some specific location

Rightick the project->build path->configure build path then import the jar to resolve those

The import javax.servlet cannot be resolved

related errors
 
Your buns are mine! But you can have this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic