This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes java.lang.NoClassDefFoundError: sun/tools/javac/Main Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Servlets
Bookmark "java.lang.NoClassDefFoundError: sun/tools/javac/Main" Watch "java.lang.NoClassDefFoundError: sun/tools/javac/Main" New topic

java.lang.NoClassDefFoundError: sun/tools/javac/Main

Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
When I tried to invoke a JSP, javac says that the root cause is "java.lang.NoClassDefFoundError: sun/tools/javac/Main". Is that the tool.jar? How can I fix this?

Joined: Apr 23, 2001
Posts: 6
There can be several reason for that
1)set the classpath till web-inf/classes
2)class file not available in classes directory
3)tool.jar not available in classpath
prashant sreenivasan

Joined: Nov 19, 2000
Posts: 6
make the classpath variable include the file JAVA_HOME\lib\tools.jar
This should solve the problem
Peter den Haan
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Some application servers (such as Orion) require you to copy tools.jar into the application server lib or root directory.
- Peter
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: java.lang.NoClassDefFoundError: sun/tools/javac/Main
It's not a secret anymore!