• 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

Trouble compiling my servlet

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am currently studying about servlets using "Head First Servlets and JSP", and I am stuck trying to build my first servlet from Ch. 3 of the book. Yes I know, it is pathetic.

I plan to move to eclipse for Java development soon, but for now I want to understand what I am doing. Unfortunately, I am stuck developing on a Windows workstation, and I am having a world of trouble getting a simple servlet to build. Windows is not exactly my forte, so I might not having something set correctly. When I compile standard java programs not using any special libraries, everything compiles just fine. When I try to make a servlet, it blows up on me. I suspect the issue is a CLASSPATH problem, but it should work unless I am missing something.

Here is my CLASSPATH variable:
CLASSPATH=.;C:\IBM\SQLLIB\java\db2java.zip;C:\IBM\SQLLIB\java\db2jcc.jar;C:\IBM\SQLLIB\java\sqlj.zip;C:\IBM\SQLLIB\java\db2jcc_license_cu.jar;C:\IBM\SQLLIB\bin;C:\IBM\SQLLIB\java\common.jar;C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib

So I have this really simple code:



Below is the screen output (sorry the workstation is Japanese...but right now I am only concerned about the first error--I will do this one step at a time...slowly). It basically says that "import javax.servlet.*;" line is failing and that it does not exist.



Any ideas? The build command is the same as the one in the textbook, except that they use UNIX and I am using Windows.
 
Bryan Douglas
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nevermind, I deleted the "...../servlet-api.jar:classes:." part and it worked. I wonder why that is put in the book?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic