I''m compiling, jarring and running from the command line.
If I don''t have my classes in a package, then everything works fine, i.e. I use javac,jar and java to compile, make a jar file, and then run a class from that jar.
But if I put my classes in a package, they won''t run.
It says something like "Exception in main: Editor (package/Editor has wrong name)."
So it looks like the class files have the package name in them correctly. When I open up the jar file with winzip, I notice that they are not in the path /package, which they should be.
So my question is how do I jar these up into the correct format?
If your package was called ''myClasses'' then your classes would have to be in a directory ''myClasses/'' and I would then run with ''java myClasses.className''. Yes the class files must live in a directory with the same name as their package, and this directory must be included in your class_path...