• Post Reply Bookmark Topic Watch Topic
  • New Topic

Still having trouble running a class that imports a custom package  RSS feed

 
Nick Neidig
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been unable to run the following class. I was able to compile Roma by entering javac mygame\partner\*.java at the command prompt.
package mygame.partner;
import mygame.client.Justy;
public class Roma extends Justy {
//main thread
}
Justy is a public class and the error I keep getting at the command prompt is NoClassDefFoundError. There is no directory before mygame on my computer. I have C:\mygame\client and C:\mygame\partner. Are mygame.client and mygame.partner appropriate package names? If you could be show me exactly how to run Roma from the command prompt that would be extremely helpful.
Thanks for your help
Nick
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you doing to run the program?
From the same directory you used to compile it, you should be able to use java mygame.partner.Roma to run it. Note that since the class definition declares a package, to run it, the class must be reference using the fully qualified name (which means, include the package).
 
Nick Neidig
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The program worked fine when I followed your advice. Thanks Dirk.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!