It's not a secret anymore!
The moose likes Beginning Java and the fly likes what does this error message mean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what does this error message mean" Watch "what does this error message mean" New topic

what does this error message mean

Rick Rod

Joined: Nov 20, 2005
Posts: 10
I am trying to compile and am getting this error message can someone tell me how to correct this.

Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/javac/M

Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

It looks like your Java installation is corrupt, as the javac command can't find the JAR file that contains the Java compiler (it's normally called "tools.jar"). I'd try reinstalling your JDK -- unless you've just done something odd like move files around yourself, in which case putting everything back where you got it should fix things.

[Jess in Action][AskingGoodQuestions]
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15092

It could also be that you have different versions of the JDK on your system and you're mixing them up because your PATH is not set correctly.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: what does this error message mean
It's not a secret anymore!