ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Urban" <jim.ur...@netsteps.net>
Subject RE: Ant Won't Compile Java Programs
Date Fri, 08 Jun 2001 13:56:28 GMT
Adding tools.jar to the classpath within ant.bat did the trick.  However, it
appears the java complier can't find any of the other jars (3rd party Java
packages) in my system classpath, do I have to add these to the ant
classpath, or am I missing something?

Jim Urban

-----Original Message-----
From: healey, alex [mailto:alexh@Midas-Kapiti.com]
Sent: Friday, June 08, 2001 8:25 AM
To: ant-user@jakarta.apache.org
Subject: RE: Ant Won't Compile Java Programs


If you look at the source this message is only generated in one place



		try {

                    Class.forName("com.sun.tools.javac.Main");

                } catch (ClassNotFoundException cnfe) {

                    task.log("Modern compiler is not available - using "

                            + "classic compiler", Project.MSG_WARN);

                    return new Javac12();

                }



inside CompilerAdapterFactory. So the problem is that the classloader
cannot find com.sun.tools.javac.Main. I would suggest again reviewing
your classpath. I refer to the classpath used for starting Ant (not any
of those used in compiling running tests, etc. in ant).



Hope this helps...



Alex Healey













-----Original Message-----
From: Jim Urban [mailto:jim.urban@netsteps.net]
Sent: Friday, June 08, 2001 2:36 PM
To: ant-user@jakarta.apache.org
Subject: RE: Ant Won't Compile Java Programs


I added d:\jdk1.3\lib\tools.jar to my CLASSPATH and I still get the same

error.



Jim Urban



-----Original Message-----

From: healey, alex [mailto:alexh@Midas-Kapiti.com]

Sent: Friday, June 08, 2001 7:57 AM

To: ant-user@jakarta.apache.org

Subject: RE: Ant Won't Compile Java Programs





I just had this problem. Just put tools.jar from the JDK into the

classpath to launch Ant.



Alex Healey



>  -----Original Message-----

> From: 	Jim Urban [mailto:jim.urban@netsteps.net]

> Sent:	Friday, June 08, 2001 2:09 PM

> To:	ant-user@jakarta.apache.org

> Subject:	Ant Won't Compile Java Programs

>

> I just installed ant on my NT 4.0 PC.  I created a simple "build.xml"

> file for one of my Java projects.  When I run ant it gives me the

> following messages:

>

> compile:

>     [javac] Modern compiler is not available - using classic compiler

>     [javac] Compiling 192 source files to D:\vcoj\build

>

> BUILD FAILED

>

> D:\vcoj\build.xml:17: Cannot use classic compiler, as it is not

> available A common solution is to set the environment variable

> JAVA_HOME to your jdk directory.

>

> I have my JAVA_HOME set to "d:\jdk1.3".  I can type

> "JAVA_HOME\bin\javac" at the command prompt within my project

> directory and the Java compiler runs just fine.  I can also simply

> type "javac" at the command prompt and run the compiler.  What is

> ant's problem?  Why does it think my compiler is not available?

>

> Jim Urban

> Project Manager

> Netsteps Inc.

> Suite 505E

> 1 Pierce Pl.

> Itasca, IL  60143

> Voice:  (630) 250-3045 x2164

> Fax:  (630) 250-3046

>


Mime
View raw message