Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to set the class path

 
trivikram Kumar
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

Just started to read HF Servlets and JSP..a very nice book.

Could someone please help me out in setting the class path for the project given in 3rd chapter in HF book
I tried many ways...but still its giving 404 error.
If you have read that book....can u please let me know how to set the class path and run the HTML on page 76 in HF.

Thanks a lot in advance,

Javainn
SCJP-1.4
 
Nitish Bahadur
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use -classpath for setting your classpath. What error are you getting?
 
trivikram Kumar
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nitesh,

I actually tried to get the result of writing a small html in the tomcat ..and tried to run it using the url...http://localhost etc...so i had set up the class path as c:/<tomact version>;in the environment variables.So its giving an error saying that the path cannot be found.

I would be glad if someone could help me out with this.

Thanks in advance,
Javainn
 
Nitish Bahadur
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recommend having a development environment, just as the book does. Create a lib directory under your development directory and copy servlet-api.jar and jsp-api.jar from $tomcat/common/lib directory into this directory.

Now for all your Servlet development you will be using javac -classpath .;c:\scwcd-dev\lib\servlet-api.jar SampleServlet.java

For Custom Tag development you will require jsp-api.jar.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic