You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Anoop kumar V <an...@gmail.com> on 2005/06/15 18:30:24 UTC

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

I am using Tomcat 4.1.30 standalone and am repeatedly facing this issue of

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

whenever I try to serve up a jsp from a specific folder within webapps.

I know that this is a classpath issue - but i have checked my
JAVA_HOME and it is pointing correctly to my jdk.
I mean I have lots of other applications working fine in the webapps
folder so JAVA_HOME has never been the issue. (the other jsp files
from other folders in webapps are served just fine)

Also from a google search someone pointed out that TOMCAT_HOME or
CATALINA_HOME needs to be set. I tried setting this too in startup.bat
and catalina.bat (even setclasspath.bat) but in vain.

I know that tomcat 4.1.30 completely ignores the system classpath - so
I have not tried to change that.

Another point is that I compiled using JDK1.5_01 but the tomcat4.1.30
I am using points to jdk1.4.2.

On Tomcat5.5 (pointing to jdk1.5) this worked like a charm - I just
dropped the war in webapps and the jsp was displayed.

Can anybody give me some pointers as to how I can automatically fix
this in 4.1.30?

Thanks in advance,
Anoop

-- 
Thanks and best regards,
Anoop

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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

Posted by Anto Paul <an...@gmail.com>.
> > Another point is that I compiled using JDK1.5_01 but the tomcat4.1.30 I am
> > using points to jdk1.4.2.
> >
> > On Tomcat5.5 (pointing to jdk1.5) this worked like a charm - I just dropped
> > the war in webapps and the jsp was displayed.
> >
> > Can anybody give me some pointers as to how I can automatically fix this in
> > 4.1.30?
> >

Different versions of JDK should be the problem. I had similar issues
with 1.3 and 1.4. I built Tomcat from source using one jdk and run
Tomcat using another jdk and I got similar errors.
Also post the full stack trace. Perhaps copying tools.jar(of 1.4) to
CATALINA_HOME\common\lib may solve the problem.
-- 
rgds
Anto Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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

Posted by Anoop kumar V <an...@gmail.com>.
Yes - I am sure - This is a line in the setclasspath.bat

set CLASSPATH=%JAVA_HOME%\lib\tools.jar

And my other webapps which have jsp work.
But for some reason this jsp which is in the struts-blank.war gives
this exception.

Anoop



On 6/15/05, Martín Cabrera <ma...@abitab.com.uy> wrote:
> Are you sure you have the %JAVA_HOME%\lib\tools.jar?...this jar contains the
> java compiler that tomcats needs in order to compile jsps pages.
> 
> Hope this helps.
> Martín.
> 
> -----Mensaje original-----
> De: Anoop kumar V [mailto:anoopkumarv@gmail.com]
> Enviado el: Miércoles, 15 de Junio de 2005 01:30 p.m.
> Para: Tomcat Users List
> Asunto: java.lang.NoClassDefFoundError: sun/tools/javac/Main
> 
> I am using Tomcat 4.1.30 standalone and am repeatedly facing this issue of
> 
> java.lang.NoClassDefFoundError: sun/tools/javac/Main
> 
> whenever I try to serve up a jsp from a specific folder within webapps.
> 
> I know that this is a classpath issue - but i have checked my JAVA_HOME and
> it is pointing correctly to my jdk.
> I mean I have lots of other applications working fine in the webapps folder
> so JAVA_HOME has never been the issue. (the other jsp files from other
> folders in webapps are served just fine)
> 
> Also from a google search someone pointed out that TOMCAT_HOME or
> CATALINA_HOME needs to be set. I tried setting this too in startup.bat and
> catalina.bat (even setclasspath.bat) but in vain.
> 
> I know that tomcat 4.1.30 completely ignores the system classpath - so I
> have not tried to change that.
> 
> Another point is that I compiled using JDK1.5_01 but the tomcat4.1.30 I am
> using points to jdk1.4.2.
> 
> On Tomcat5.5 (pointing to jdk1.5) this worked like a charm - I just dropped
> the war in webapps and the jsp was displayed.
> 
> Can anybody give me some pointers as to how I can automatically fix this in
> 4.1.30?
> 
> Thanks in advance,
> Anoop
> 
> --
> Thanks and best regards,
> Anoop
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> --
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 267.7.3 - Release Date: 14/06/2005
> 
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 267.7.3 - Release Date: 14/06/2005
> 
> 
> 


-- 
Thanks and best regards,
Anoop

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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

Posted by Martín Cabrera <ma...@abitab.com.uy>.
Are you sure you have the %JAVA_HOME%\lib\tools.jar?...this jar contains the
java compiler that tomcats needs in order to compile jsps pages.

Hope this helps.
Martín. 

-----Mensaje original-----
De: Anoop kumar V [mailto:anoopkumarv@gmail.com] 
Enviado el: Miércoles, 15 de Junio de 2005 01:30 p.m.
Para: Tomcat Users List
Asunto: java.lang.NoClassDefFoundError: sun/tools/javac/Main

I am using Tomcat 4.1.30 standalone and am repeatedly facing this issue of

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

whenever I try to serve up a jsp from a specific folder within webapps.

I know that this is a classpath issue - but i have checked my JAVA_HOME and
it is pointing correctly to my jdk.
I mean I have lots of other applications working fine in the webapps folder
so JAVA_HOME has never been the issue. (the other jsp files from other
folders in webapps are served just fine)

Also from a google search someone pointed out that TOMCAT_HOME or
CATALINA_HOME needs to be set. I tried setting this too in startup.bat and
catalina.bat (even setclasspath.bat) but in vain.

I know that tomcat 4.1.30 completely ignores the system classpath - so I
have not tried to change that.

Another point is that I compiled using JDK1.5_01 but the tomcat4.1.30 I am
using points to jdk1.4.2.

On Tomcat5.5 (pointing to jdk1.5) this worked like a charm - I just dropped
the war in webapps and the jsp was displayed.

Can anybody give me some pointers as to how I can automatically fix this in
4.1.30?

Thanks in advance,
Anoop

--
Thanks and best regards,
Anoop

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 267.7.3 - Release Date: 14/06/2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 267.7.3 - Release Date: 14/06/2005
 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org