Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tomcat gives java.lang.NoClassDefFoundError: sun/tools/javac/Main when running JSP

6 views
Skip to first unread message

Marshall A. Levin

unread,
Dec 4, 2000, 3:00:00 AM12/4/00
to
Hello,

I have seen this question asked several times and each time the
suggestion is to make sure that tools.jar is in the classpath. It
looks like I _do_ have tools.jar in the classpath and I am still having
the problem. Can anyone suggest a solution? I'm on NT Workstation
using JDK 1.2.1. Here's the output of the problem -- it happens as
soon as I click on the link for the JSP.

C:\jakarta-tomcat\bin>echo %PATH%
C:\jdk1.2.2\bin;C:\WINNT\system32;C:\WINNT;C:\DMI\bin;C:\WINNT\System32
\WBEM;C:\Program Files\Network Associates\PGPNT

C:\jakarta-tomcat\bin>echo %JAVA_HOME%
C:\jdk1.2.1

C:\jakarta-tomcat\bin>tomcat run
Using classpath: C:\jakarta-tomcat\classes;C:\jakarta-
tomcat\lib\webserver.jar;C:\jakarta-tomcat\lib\jasper.jar;C:\jakarta-
tomcat\lib\xml.jar;C:\jakarta-tomcat\lib\servlet.jar;C:\jdk1.2.1
\lib\tools.jar
Starting tomcat. Check logs/tomcat.log for error messages
Unhandled error! You might want to consider having an error page to
report such errors more gracefully
java.lang.NoClassDefFoundError: sun/tools/javac/Main
at org.apache.jasper.compiler.SunJavaCompiler.compile
(SunJavaCompiler.java:128)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java,
Compiled Code)
at org.apache.jasper.runtime.JspServlet.loadJSP
(JspServlet.java:413)
at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary
(JspServlet.java:149)
at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service
(JspServlet.java:161)
at org.apache.jasper.runtime.JspServlet.serviceJspFile
(JspServlet.java:261)
at org.apache.jasper.runtime.JspServlet.service
(JspServlet.java, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.handleRequest
(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.ContextManager.service
(ContextManager.java:559)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection
(HttpConnectionHandler.java:160)
at org.apache.tomcat.service.TcpConnectionThread.run
(SimpleTcpEndpoint.java:338)
at java.lang.Thread.run(Thread.java:479)

Thanks,
-ML


Sent via Deja.com http://www.deja.com/
Before you buy.

Nils O. Selåsdal

unread,
Dec 5, 2000, 2:39:55 AM12/5/00
to
As they suggested earlier make tools.jar in your CLASSPATH!!!
As far as i can see it isnt!!
Type:
set CLASSPATH=%CLASSPATH%:%JAVA_HOME%/lib/tools.jar;
before you start tomcat...
also some other things... in your PATH, there's a c:\jdk1.2.2 , but
JAVA_HOME points to c:\jdk1.2.1
Both these should be the same jdk1.x
(also , upgrade to v1.3 ;)

"Marshall A. Levin" <mle...@meadhall.com> wrote in message
news:90h17i$k8b$1...@nnrp1.deja.com...
> Hello,

Jon Skeet

unread,
Dec 5, 2000, 3:00:00 AM12/5/00
to
mle...@meadhall.com wrote:
> Hello,
>
> I have seen this question asked several times and each time the
> suggestion is to make sure that tools.jar is in the classpath. It
> looks like I _do_ have tools.jar in the classpath and I am still having
> the problem. Can anyone suggest a solution? I'm on NT Workstation
> using JDK 1.2.1. Here's the output of the problem -- it happens as
> soon as I click on the link for the JSP.
>
> C:\jakarta-tomcat\bin>echo %PATH%
> C:\jdk1.2.2\bin;C:\WINNT\system32;C:\WINNT;C:\DMI\bin;C:\WINNT\System32
> \WBEM;C:\Program Files\Network Associates\PGPNT
>
> C:\jakarta-tomcat\bin>echo %JAVA_HOME%
> C:\jdk1.2.1

Are you *sure* you're using jdk1.2.1? Your path contains c:\jdk1.2.2\bin
- make sure the environment variables match reality and have another go.

--
Jon Skeet - sk...@pobox.com
http://www.pobox.com/~skeet

0 new messages