I have three classes Game that contains the main method, SimpleDotCom and GameHelper
the Game class and SimpleDotCom are within chap05 package, GameHelper within a package helper that is in the directory chap05.
I have complied the three classes using javac *.java
Now I want to run the classes but I do not know how
I tried java Game
it does not work
Then I tried java chap05.Game
it also does not work and gives the following error
Exception in
thread "main" java.lang.NoClassDefFoundError: helpers/GameHelper
at chap05.Game.main(Game.java:11)
Caused by: java.lang.ClassNotFoundException: helpers.GameHelper
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 1 more
I can see that it has something to do with the package helpers but I don't know what
I will really appreciate your help