Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
My Directory structure is as follows root i added the following in the classpath
Add d:\root (not d:\root\pack1;d:\root\pack2) to your classpath. With the JDK, your package statements and directory structure are interrelated. When trying to find your class "pkg2.SUBCLASS", the compiler will look in each of the directories in your classpath for a subdirectory matching the package name of the class. In this case, it looks for a subdirectory called "pkg2". If your class was in the package "com.artima.foobar", it would expect you to have the directory structure "com\artima\foobar". Take a look at any of the .jar or .zip files in your classpath, and you'll see that the directory structure within these compressed files matches the package structure as well.
Replies: |
Sponsored Links
|