File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java 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 » Beginning Java
Bookmark "package and classpath" Watch "package and classpath" New topic
Author

package and classpath

Steven Zeng
Ranch Hand

Joined: Jan 15, 2002
Posts: 41
Now i have compiled new package,but in other java programs i can not import this package,although i set the enviroment variable "classpath" to that the path of new pachage.I do all these under Windows 2000 Server.If the path of the package is C:\package1, and I add this to enviroment variable classpath ,but it is in vain.Who can tell me how to do next?Thanks in advance.


SCJP2
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
I suspect that you are on the right path. What is the exact structure of your package and relevant disk drive(s) including the full name of the package? What exactly does your classpath setting look like?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
I'm not familiar with configuring 2K server, but on 2K Pro, there are two sets of environmental variables: system and user. Be sure you set the Classpath in the user if you are not executing from a system context.
Hope this helps,
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Steven Zeng
Ranch Hand

Joined: Jan 15, 2002
Posts: 41
Hi,Dirk and Michael,the full name of the package is "oracle.jdbc.driver",all class files of this package are under this path "c:\oracle\ora8i\jdbc", so I set the system and user enviroment variable both to this path(thank you for reminding me this point,Mickael,I indeed set it ).And I am sure that I declared the package name in the source file.
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9046
    
  10
You should set the CLASSPATH environment variable to the directory/subdirectory where the package is rather than the subdirectory where the classes are. In this case, your package is oracle.jdbc.driver in the C:\ directory. You should have C:\ in your CLASSPATH.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
the full name of the package is "oracle.jdbc.driver",all class files of this package are under this path "c:\oracle\ora8i\jdbc"
You have a problem here. Your package name/structure doesn't match your folder name/structure. These need to be the same.
Steven Zeng
Ranch Hand

Joined: Jan 15, 2002
Posts: 41
Thank you,all, I have import the package i want by setting the enviroment variable correctly(yes,the hierarchy of pachage should be same to the path hierarchy),I really appreciate your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: package and classpath