The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
September 2001

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:

simple java exception

Posted by juri on November 06, 2001 at 10:34 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).

> - MFG






Replies:

Sponsored Links



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