Trying to create a package
I'm trying to create a package of objects to use in other programs.
I set the package up like:
package mypack;
public class objecta
{
...
}
class objectb ...
However when I include the package (with the package in a directory
in my classpath) like
import mypack.*;
I get a 'package mypack does not exist' error at compile time.
[404 byte] By [
narcca] at [2007-9-27 7:56:46]

If you want to create a mypack package, you need to have the .class files under a mypack directory on your filesystem. E.g.
Say you are working on a package test project (a project to test putting java objects in a package). You would create a directory on your machine to hold this project:
Directory: /java/packageTest/
Then you would put all your source files under the directory:
/java/packageTest/source
To test the packaged object, you would create the package mypack under the directory:
/java/packageTest/source/mypack
Then you would have to compile this class:
cd /java/packageTest/source/mypack
javac MyPackagedObject.java
Then you would want to test that it runs:
cd /java/packageTest/
java mypack.MyPackagedObject
Voila! A running packaged object!
BTW, if you want to compile a number of classes in their respective packages, you would have to compile them from the base directory, i.e.:
cd /java/packageTest/source
javac mypack/*.java
HTH,
Manuel Amago.