File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes package and classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "package and classpath" Watch "package and classpath" New topic

package and classpath

Shuaib Gill
Ranch Hand

Joined: May 29, 2001
Posts: 62
Hi folks,
Suppose I have some code which starts off with....
import java.util.*;
import com.oreilly.servlet.MultipartRequest; // user defined
// java code goes here...
How do I change my Java environment in order to compile and run this program since the package I am importing is user defined? Do I have to change my classpath, or should I put this package in a certain file directory on my hard drive? Any help would be greatly appreciated.

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
One approach would be to put the extra classes where the servlet engine will look for them when your servlet is running, then set your classpath to point to that location. If you are using an IDE like Visual Cafe, you can include that path as part of the project instead of setting the classpath environment variable.
I agree. Here's the link:
subject: package and classpath
It's not a secret anymore!