We have been supplied with a bunch of example code files for an assignment. Each file hasat the top. I can't get any of the files to run if I have the package stuff at the top, but if I remove the line from each file they run fine.package FabricCuts
What I've tried:
1. Creating a new directory FabricCuts and moving all files inside.
Here is the error I see with a bit of context.
> ls Garment.java GarmentFile.java GarmentFileTest.java Piece.java PieceTest1.java TextFile.java TextFileTest.java > javac PieceTest1.java Piece.java > java PieceTest1 Exception in thread "main" java.lang.NoClassDefFoundError: PieceTest1 (wrong name: FabricCuts/PieceTest1) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) >
As I said everything works fine if I remove the package line from the top of each file, but I'd rather know how it is supposed to work.
Thanks.