So there's a folder
/usr/share/stuff in the root directory
in stuff there are a bunch of java files with
package org.name definitions at the top
I am running
javac test.java where
test.java is in a subdomain
/usr/share/stuff to my class path.
and at the top of
test.java I add
But I get a
package does not exist error...why?
Are they in the right subdirectories?
If you put
/usr/share/stuffon the class path, files defined with
package org.nameshould be in
EDIT: If you don't already know this, you should probably read this: http://download.oracle.com/javase/1.5.0/docs/tooldocs/windows/classpath.html#Understanding
EDIT 2: Sorry, I hadn't realised you were talking of Java source files in
/usr/share/stuff. Not only they need to be in the appropriate sub-directory, but you need to compile them. The
.javafiles don't need to be on the classpath, but on the source path. (The generated
.classfiles need to be on the classpath.)
You might get away with compiling them if they're not under the right directory structure, but they should be, or it will generate warnings at least. The generated class files will be in the right subdirectories (wherever you've specified
-dif you have).
You should use something like
javac -sourcepath .:/usr/share/stuff test.java, assuming you've put the
.javafiles that were under
/usr/share/stuff/org/name(or whatever is appropriate according to their package names).