jQuery in Action, 2nd edition*
The moose likes Servlets and the fly likes servlet packages problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet packages problem" Watch "servlet packages problem" New topic
Author

servlet packages problem

rudolf hitler
Ranch Hand

Joined: Feb 07, 2003
Posts: 34
Hi,
I have these 2 codes both placed in the same package called moreservlets.one file is called serutilities.java and the other called helloservlet.java.helloservlet.java uses serutilities.java.I have put c:\moreservlets in my classspath along with "." but my file helloservlet does not compile it gives an error on the line where i use a static method from serutilities.java in helloservlet.java.The access modifier is public for both classes.Can u help me out with what the error might be??
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1134

Hi Madhu,
The servlet engines that I have worked with all use their own CLASSPATH -- which is totally independent of yours! So you need to configure your servlet engine's CLASSPATH -- to include "C:\moreservlets".
How you configure the servlet engine's classpath depends on the servlet engine you are using -- but I'm sure the details can be found in the documentation (for your servlet engine).
Hope this helps.
Good Luck,
Avi.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Avi... the problem was with compilation.

madhu, I think I recognize a few names in your post. Are you looking at moreservlets ?

Try this post:
http://www.coderanch.com/t/354473/Servlets/java/Packages-Utility-Classes-Servlets

The most important bit of that post is where I link to *another* post... (for the short version, just go here): http://www.coderanch.com/t/354453/Servlets/java/Unable-compile-package

The important part of THAT post is mine, at the very bottom
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet packages problem