Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

who can answer me this simple question?

 
ang_yin
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when I execute the program underbelow,
there is always a wrong :
Exception in thread "main" java.lang.NoClassDefFoundError: MusicClient
what is wrong with the program?? please help me

public class MusicClient
{

public static void main(String[] args)
{

System.out.println("test");

}
}
 
omar khan
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ang_yin:
Exception in thread "main" java.lang.NoClassDefFoundError: MusicClient

From the directory where there is MusicClient.class launch

It should work.
Your classpath is not properly set.
 
Paddy Totti
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it still not work, u can try to reinstall jdk again
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ang_yin,
Please change your name to be compliant with JavaRanch's naming policy.
Your ID should be 2 separate names with more than 1 letter each. You need to remove the underscore. We really want this to be a professional forum and would prefer that you use your REAL name.
Thanks,
Cindy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic