You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Drasko Kokic <dr...@yahoo.com> on 2000/10/11 13:49:37 UTC

Re: Compile Problems Tomcat3.1

The CLASSPATH should contain the tools.jar ... that
worked for me.

Does anybody know why is setting JAVA_HOME not
enough???

Drasko


--- Rafael Merino <ra...@usa.net> wrote:
> 
> Hi,
> 
> I am having problems with my build.bat file during
> the compile. The error I
> get is as follows:
> 
> Buildfile: build.xml
> Project base dir set to: E:\source\wap2
> The items attribute is deprecated. Please use the
> includes attribute.
> The items attribute is deprecated. Please use the
> includes attribute.
> Executing Target: clean
> Deleting: D:\jakarta-tomcat\webapps\koala
> Executing Target: prepare
> Created dir: D:\jakarta-tomcat\webapps\koala
> Copying 4 files to D:\jakarta-tomcat\webapps\koala
> Created dir: D:\jakarta-tomcat\webapps\koala\WEB-INF
> Created dir:
> D:\jakarta-tomcat\webapps\koala\WEB-INF\classes
> Created dir:
> D:\jakarta-tomcat\webapps\koala\WEB-INF\lib
> Created dir: D:\jakarta-tomcat\webapps\koala\javadoc
> Executing Target: compile
> Compiling 1 source files to
> D:\jakarta-tomcat\webapps\koala\WEB-INF\classes
> Exception in thread "main"
> java.lang.NoClassDefFoundError:
> sun/tools/javac/Main
>         at
>
org.apache.tools.ant.taskdefs.Javac.doClassicCompile(Javac.java:421)
>         at
>
org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:218)
>         at
> org.apache.tools.ant.Target.execute(Target.java:120)
>         at
>
org.apache.tools.ant.Project.runTarget(Project.java:675)
>         at
>
org.apache.tools.ant.Project.executeTarget(Project.java:422)
>         at
> org.apache.tools.ant.Main.runBuild(Main.java:240)
>         at
> org.apache.tools.ant.Main.main(Main.java:191)
> 
> I am running Tomcat3.1 and JDK1.2.2 on WINNT4SP6. I
> have tried copying the
> tools.jar into the jakarta-tomcat/lib directory but
> doesn't seem to make any
> difference.
> 
> Not sure what to try next. Any advice would be
> appreciated. 
> 
> My Configuration is as follows:
> Classpath is set to the jdk1.2.2/bin, ANT_HOME is
> set to the jakarta-tomcat
> directory as is the TOMCAT_HOME, JAVA_HOME is set to
> the jdk1.2.2 directory,
> and jdk1.2.2/bin is in the path.
> 
> The build.bat file is as follows:
> 
> @echo off
> rem build.bat -- Build Script for the "Hello, World"
> Application
> rem $Id: build.bat,v 1.1 2000/04/04 22:01:13
> craigmcc Exp $
> 
> if %CLASSPATH% == "" goto noclasspath
> 
> :haveclasspath
> set _CLASSPATH=%CLASSPATH%
> set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME\classes
> goto restofclasspath
> 
> :noclasspath
> set _CLASSPATH=
> set CLASSPATH=%TOMCAT_HOME%\classes
> 
> :restofclasspath
> set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\ant.jar
> set
> CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\jasper.jar
> set
> CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet.jar
> set
>
CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\webserver.jar
> set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xml.jar
> 
> 
> type classpath
> 
> rem Execute ANT to perform the requested build
> target
> java org.apache.tools.ant.Main
> -Dtomcat.home=%TOMCAT_HOME% %1 %2 %3 %4 %5 %6
> %7 %8 %9
> 
> set CLASSPATH=%_CLASSPATH%
> set _CLASSPATH=
> 
> 
> The build.xml file is as follows:
> 
> <project name="koala" default="compile" basedir=".">
> 
> <!-- Simple "koala" project to provide a concrete
> example of
>      the recommendations in the Application
> Developer's Guide.
> 
>      NOTE:  Before using this file as is, you should
> review the
>      values for the properties that are defined
> below.
>      In particular, it is assumed that you wish to
> install this
>      application under context path "/myapp" in the
> Tomcat installation
>      defined by your TOMCAT_HOME environment
> variable.
> -->
> 
>   <property name="app.name"       value="koala"/>
>   <property name="deploy.home"   
> value="${tomcat.home}/webapps/${app.name}"/>
>   <property name="dist.home"     
> value="${deploy.home}"/>
>   <property name="dist.src"      
> value="${app.name}.jar"/>
>   <property name="dist.war"      
> value="${app.name}.war"/>
>   <property name="javadoc.home"  
> value="${deploy.home}/javadoc"/>
>   <property name="build.compiler" value="classic"/> 
> 
> 
>   <target name="prepare" init="init">
>     <mkdir dir="${deploy.home}"/>
>     <copydir src="web" dest="${deploy.home}"/>
>     <mkdir dir="${deploy.home}/WEB-INF"/>
>     <copyfile src="etc/web.xml"
> dest="${deploy.home}/WEB-INF/web.xml"/>
>     <mkdir dir="${deploy.home}/WEB-INF/classes"/>
>     <mkdir dir="${deploy.home}/WEB-INF/lib"/>
>     <copydir src="lib" dest="${deploy.home}/lib"/>
>     <mkdir dir="${javadoc.home}"/>
>   </target>
> 
> 
>   <target name="clean" init="init">
>     <deltree dir="${deploy.home}"/>
>   </target>
> 
> 
>   <target name="compile" depends="prepare"
> init="init">
>     <javac srcdir="src"
> destdir="${deploy.home}/WEB-INF/classes"
>           
> classpath="${deploy.home}/WEB-INF/classes"
>            debug="on" optimize="off"
> deprecation="off"/>
>   </target>
> 
> 
>   <target name="javadoc" depends="prepare"
> init="init">
>     <!-- TODO -->
>   </target>
> 
> 
>   <target name="all"
> depends="clean,prepare,compile,javadoc"
> init="init"/>
> 
> 
>   <target name="dist" depends="prepare,compile"
> init="init">
>     <jar jarfile="${dist.home}/${dist.src}"
>          basedir="." items="*"/>
>     <jar jarfile="${dist.home}/${dist.war}"
>          basedir="${deploy.home}" items="*"/>
>   </target>
> 
> 
> </project>
> 
> Thanks in Advance 
> 
> Rafael Merino
> 
> 
> 
> 
>
____________________________________________________________________
> Get free email and a permanent address at
http://www.netaddress.com/?N=1


__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/