• 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

Eclipse Bug?

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm sure it's something I'm doing wrong, but when I try to import javax.servlet.* into a Java file, Eclipse refuses to recognize it. I've tried everything I can think of, but it still acts like that's not part of Java.
But when I compile it from TextPad, I get no errors.
Any ideas?
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eclipse has its own classpath settings, and ignores the classpath from the external system.
With your project open in Eclipse, go to the "project" menu at the top. At the botton of that menu you should see "properties". Click this to open the project properties browser dialog. On the left you should see a list of property groups. Click "Java Build Path" then select the "Libraries" tab.
You now need to click the "Add External JARs" button at the right of the dialog, and navigate the file opener to wherever your servlet jar lives. Select the appropriate jar file and it will be added to the classpath for the Eclipse project.
You should then find that you can compile servlet code with no problem. All you need now is to get your code working
 
Bigglesworth Naruki
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bravo! Thank you, it's working perfectly now. I knew I was doing something stupid.
reply
    Bookmark Topic Watch Topic
  • New Topic