File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "package and classpath" Watch "package and classpath" New topic
Author

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.io.*;
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.


programmer77
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12675
    
    5
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.
Bill

Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: package and classpath
 
Similar Threads
trouble calling a java imported class in a jsp page
error compiling a servlet
Using CachedRowSet
importing custom class/method into servlet; servlet and finding classpath?
classpath and path