ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Murdoch" <adammurdoch...@yahoo.com>
Subject RE: Cannot use classic compiler
Date Tue, 01 Jan 2002 10:14:46 GMT

Hi,

It's probably simpler if you use the bat script that comes with Ant, rather
than trying to start Ant using 'java' directly.  The bat script takes care
of setting up the classpath for you.  Have a read of "Installing Ant" and
"Running Ant" in the user manual for more info.

Otherwise, if you really do want to use 'java' to start Ant, you will need
to make sure that $JAVA_HOME\lib\tools.jar is in the classpath (along with
all the other stuff it needs).


Adam

> -----Original Message-----
> From: SHAJI K K [mailto:KKSHAJI@nestec.net]
> Sent: Tuesday, 1 January 2002 7:58 PM
> To: ant-user@jakarta.apache.org
> Subject: Cannot use classic compiler
>
>
> Hi
> 	I am facing a problem while using ant the details of which is given
> below
>
> Ant Version-  1.4.1
> JDK 	       -1.3 sun
>
> I created a build.xml file to compile a test program  .
> i run ant using the command "java org.apache.tools.ant.Main -v"  from the
> source directory.
> But the build is failed. The dump i got is below
>
> ------------------------------------------------
> $ java org.apache.tools.ant.Main -v
> Ant version 1.4.1 compiled on October 11 2001
> Buildfile: build.xml
> Detected Java version: 1.3 in: C:\Program Files\JavaSoft\JRE\1.3
> Detected OS: Windows NT
> parsing buildfile d:\temp\Javatest\build.xml with URI =
> file:d:/temp/Javatest
> ild.xml
> Project base dir set to: D:\temp\Javatest
> Build sequence for target `dist' is [init, compile, dist]
> Complete build sequence is [init, compile, dist, clean]
>
> init:
>
> compile:
>     [javac] TestApp.java added as D:\temp\Javatest\build\TestApp.class
> doesn'
> xist.
>     [javac] build.xml skipped - don't know how to handle it
>     [javac] TestApp.class skipped - don't know how to handle it
>     [javac] dist\lib\MyProject-20020101.jar skipped - don't know how to
> handl
> t
>     [javac] build.sh skipped - don't know how to handle it
>     [javac] Modern compiler is not available - using classic compiler
>     [javac] Compiling 1 source file to D:\temp\Javatest\build
>     [javac] Using classic compiler
>     [javac] Compilation args: -d D:\temp\Javatest\build -classpath
> "D:\temp\J
> test\build;G:\program files\Exceed\hcljrcsv.zip;G:\program
> files\Exceed;D:\Pr
> am Files\jakarta-ant-1.4.1\lib\ant.jar" -sourcepath
> D:\temp\Javatest -g:none
>     [javac] File to be compiled:
>     D:\temp\Javatest\TestApp.java
>
>
> BUILD FAILED
>
> d:\temp\Javatest\build.xml:17: Cannot use classic compiler, as it is not
> avai
> le A common solution is to set the environment variable JAVA_HOME to your
> jdk
> rectory.
>         at
> org.apache.tools.ant.taskdefs.compilers.Javac12.execute(Javac12.ja
> 96)
>         at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:557)
>         at org.apache.tools.ant.Task.perform(Task.java:217)
>         at org.apache.tools.ant.Target.execute(Target.java:184)
>         at org.apache.tools.ant.Target.performTasks(Target.java:202)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:601)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:560)
>         at org.apache.tools.ant.Main.runBuild(Main.java:454)
>         at org.apache.tools.ant.Main.start(Main.java:153)
>         at org.apache.tools.ant.Main.main(Main.java:176)
>
> Total time: 1 second
> -----------------------------------------------
>
>
> I have created the JAVA_HOME environment varaible and i could
> compile using
> javac.
> but i get the above error when use ant to compile.
>
> Any help is much appreciated.
>
>
> regards
> Shaji K.K
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:ant-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message