Hey, basically im doing coursework to program a virtual robot to navigate its way through a maze, and im writing the code for this to happen. So, i can compile the code in the context of the maze environment, using javac -classpath maze-environment.jar MyController.java and this compiles fine and will also work okay when i add the resulting .class file to the maze environment and test it. However when i try to run the controller from the Terminal (Im on Mac OSX btw), i get the following error message:
java -classpath maze-environment.jar MyController.java
Exception in thread "main" java.lang.NoClassDefFoundError: MyController/java
Caused by: java.lang.ClassNotFoundException: MyController.java
at java.net.URLClassLoader$1.run(URLClassLoader.java: 202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 47)
Can anyone help me out with this? :/ Any help is much appreciated!