This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Cameron Park
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
gsaha
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
make the classpath variable include the file JAVA_HOME\lib\tools.jar
This should solve the problem
Prashant
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some application servers (such as Orion) require you to copy tools.jar into the application server lib or root directory.
- Peter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic