• 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

Classpath issues

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have set my classpath to "c:\jdk1.3;." and tried to compile what should be a textbook "hello world" servlet.
When I compiled it using "javac HelloWorld.java", I got a lot of errors like "import javax.servlet.*;" not found. These looked like classic Classpath problems, but I triple checked the class path, and it is correct. When I compile with "javac -extdirs c:\jdk1.3 Hello.java" it works no problem.
Any ideas? I'm going to reboot again and try redoing everything.
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bruce:
You need servlet.jar in your class path. Actually something that includes the javax.servlet package.
Easiest way I would suggest is to use Tomcat. Pl. search
this forum for Tomcat instructions and any one thread can
help you.
I am not sure why you are comparing HelloWorld.java and
Hello.java. Are they the same programs or are they different?
regds.
- satya
 
Bruce Wingate
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The file name mix-up was just a typing error in my message.
I'm running JRun at home instead of Tomcat, but that should not affect the compiling if the jar with the servlet info is in the path. (In my case, the javax.servlet stuff is in jsdk.jar, which is in the jdk1.3 directory.) My regular java programs compile fine, and the src.jar is also in the jdk1.3 directory.
Any other suggestions?
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't you have to explicitly name the .jar on the classpath?
reply
    Bookmark Topic Watch Topic
  • New Topic