The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
September 2001



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.


simple java exception

Posted by Matt Gerrans on September 30, 2001 at 3:58 PM

This is probably because JBuilder usually makes a package of all your classes for you based on your project name. When you compile on the command line from the same directory, the javac compiler is looking in the classpath and then appending the package name in order to find your classes, but since they are in the current directory, it misses them. If you tried to compile with javac from the parent directory of the directory where the files are, it will probably work, if the directory where the files are matches the package name.

Or you could just remove the "package projectname;" line from the start of both files and they will compile with the default package.

Another idea, which I just thought of, but have not tried, is to put ".." in the classpath (it might work for single-part package names, but wouldn't be good for the standard "com.gerrans.util" type package names).



Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us