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

Posted on 2001-08-15
Last Modified: 2013-11-21

javax.servlet.ServletException: sun/tools/javac/Main
java.lang.NoClassDefFoundError: sun/tools/javac/Main

I am getting this error whenever I try to run Tomcat 3.2 sample code.

is there a way to fix this?

Question by:xxxJohnnyBlaze
  • 3
LVL 19

Expert Comment

by:Jim Cakalic
ID: 6390361
I believe this can be corrected by adding tools.jar to the server's classpath. The tools.jar is usually to be found in the lib directory of your JDK installation.

LVL 19

Expert Comment

by:Jim Cakalic
ID: 6390387
It may also be necessary to add the bin directory of your JDK installation to the PATH variable used by Tomcat.
LVL 19

Accepted Solution

Jim Cakalic earned 50 total points
ID: 6390418
And, for what it's worth, here's a link to a jguru FAQ entry on this topic:

Expert Comment

ID: 6391612
Set the environment variables TOMCAT_HOME to your Tomcat installation directory and JAVA_HOME to your Java installation directory. This has the side-effects of setting up the classpath for Tomcat correctly (that tools.jar is found and the is loaded).

Author Comment

ID: 6393040
thanks for your help again, Jim

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Protect jar file - windows app 2 39
JDeveloper 12c for 32 bit 4 71
Java passing arguments (type error) 2 48
github account with ecipse 1 42
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now