• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

package and classpath

 
Steven Zeng
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Steven Zeng
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9065
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic