• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

package and classpath

 
Shuaib Gill
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic