• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Classpath issues

 
Bruce Wingate
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • 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.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
Geoff Tate
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't you have to explicitly name the .jar on the classpath?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic