You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Sebastien Boving <se...@cirquedigital.com> on 2001/12/04 04:02:21 UTC

Ant 1.4.1 / JDK 1.4 beta3: '

Hi,

I'm having problems getting Ant 1.4.1 to work with JDK 1.4 beta3.
I get the 'Cannot use classic compiler' error:

[seb@ART002001] 150 # ant compile
Buildfile: build.xml

init:

compile:
    [javac] Modern compiler is not available - using classic compiler
    [javac] Compiling 11 source files to H:\dev\java\obj

BUILD FAILED

H:\dev\java\build.xml:14: Cannot use classic compiler, as it is not
available A common solution is to set the environment variable JAVA_HOME
to your jdk directory.

Total time: 3 seconds
Exit 1


I looked this up in the archives, and it seems other people had this
problem, but the solution was always adding tools.jar to the classpath
(or setting up JAVA_HOME correctly). I however think these things are
fine, and running ant in debug mode seems to confirm this:

Mon 03/12/01 18:55 H:/dev/java
[seb@ART002001] 151 # ant -debug compile |& less
Ant version 1.4 compiled on September 3 2001
Buildfile: build.xml
Setting project property: ant.java.version -> 1.4
Detected Java version: 1.4 in: s:\soft\win-ix86\j2sdk\1.4.0b3\jre
Detected OS: Windows 2000
 +User task: tar     org.apache.tools.ant.taskdefs.Tar
 +User task: fail     org.apache.tools.ant.taskdefs.Exit
[...]
Setting project property: java.specification.version -> 1.4
Setting project property: java.class.path ->
s:\soft\common\ant\1.4.1\lib\optional.jar;s:\soft\common\ant\1.4.1\lib\jaxp.jar;s:\soft\common\ant\1.4.1\lib\crimson.jar;s:\soft\common\ant\1.4.1\lib\ant.jar;s:\soft\win-ix86\j2sdk\1.4.0b3\lib;s:\soft\win-ix86\j2sdk\1.4.0b3\lib\tools.jar;s:\soft\win-ix86\j2sdk\1.4.0b3\lib\tools.jar

Setting project property: user.name -> seb
Setting project property: java.vm.specification.version -> 1.0
Setting project property: java.home ->
s:\soft\win-ix86\j2sdk\1.4.0b3\jre
[...]

BUILD FAILED

H:\dev\java\build.xml:14: Cannot use classic compiler, as it is not
available A common solution is to set the environment variable JAVA_HOME
to your jdk directory.
        at
org.apache.tools.ant.taskdefs.compilers.Javac12.execute(Javac12.java:96)

        at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:530)
        at org.apache.tools.ant.Task.perform(Task.java:217)
        at org.apache.tools.ant.Target.execute(Target.java:164)
        at org.apache.tools.ant.Target.performTasks(Target.java:182)
        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)

(Note the java.class.path). This happens though:

Mon 03/12/01 18:57 H:/dev/java
[seb@ART002001] 152 # ls -l s:/soft/win-ix86/j2sdk/1.4.0b3/lib/tools.jar

-rw-r--r--   1 administ None      4822168 Dec  3 14:44
s:/soft/win-ix86/j2sdk/1.4.0b3/lib/tools.jar

Mon 03/12/01 18:58 H:/dev/java
[seb@ART002001] 154 # jar tvf
s:/soft/win-ix86/j2sdk/1.4.0b3/lib/tools.jar sun/tools/javac/Main.class
 13253 Sat Oct 20 01:16:08 PDT 2001 sun/tools/javac/Main.class

So i don't really understand what's wrong here, unless Ant 1.4.1 has an
issue with the Sun 1.4 beta 3 SDK?

Any help would be appreciated!

Sebastien.


Re: Ant 1.4.1 / JDK 1.4 beta3: '

Posted by Sebastien Boving <se...@cirquedigital.com>.
Some more on this 'Modern compiler is not available / Cannot use classic
compiler' problem:

I've been trying Ant 1.4, and JDK 1.3.1_01, local installations iso
having these reside on a SMB server: always the same problem.
I do set JAVA_HOME properly, and setting CLASSPATH to tools.jar doesn't
help either. Building using a minimal build file still gives me the
error message.

If i run 'ant -debug', i do get tools.jar in 'java.class.path'.

There must be something very basic that's wrong (some other environment
in this machine / ...) on this Win2k machine.

tia,
Sebastien.


Sebastien Boving wrote:

> Hi,
>
> I'm having problems getting Ant 1.4.1 to work with JDK 1.4 beta3.
> I get the 'Cannot use classic compiler' error:
>
> [seb@ART002001] 150 # ant compile
> Buildfile: build.xml
>
> init:
>
> compile:
>     [javac] Modern compiler is not available - using classic compiler
>     [javac] Compiling 11 source files to H:\dev\java\obj
>
> BUILD FAILED
>
> H:\dev\java\build.xml:14: Cannot use classic compiler, as it is not
> available A common solution is to set the environment variable
> JAVA_HOME to your jdk directory.
>
> Total time: 3 seconds
> Exit 1
>
>
> I looked this up in the archives, and it seems other people had this
> problem, but the solution was always adding tools.jar to the classpath
> (or setting up JAVA_HOME correctly). I however think these things are
> fine, and running ant in debug mode seems to confirm this:
>
> Mon 03/12/01 18:55 H:/dev/java
> [seb@ART002001] 151 # ant -debug compile |& less
> Ant version 1.4 compiled on September 3 2001
> Buildfile: build.xml
> Setting project property: ant.java.version -> 1.4
> Detected Java version: 1.4 in: s:\soft\win-ix86\j2sdk\1.4.0b3\jre
> Detected OS: Windows 2000
>  +User task: tar     org.apache.tools.ant.taskdefs.Tar
>  +User task: fail     org.apache.tools.ant.taskdefs.Exit
> [...]
> Setting project property: java.specification.version -> 1.4
> Setting project property: java.class.path ->
> s:\soft\common\ant\1.4.1\lib\optional.jar;s:\soft\common\ant\1.4.1\lib\jaxp.jar;s:\soft\common\ant\1.4.1\lib\crimson.jar;s:\soft\common\ant\1.4.1\lib\ant.jar;s:\soft\win-ix86\j2sdk\1.4.0b3\lib;s:\soft\win-ix86\j2sdk\1.4.0b3\lib\tools.jar;s:\soft\win-ix86\j2sdk\1.4.0b3\lib\tools.jar
>
> Setting project property: user.name -> seb
> Setting project property: java.vm.specification.version -> 1.0
> Setting project property: java.home ->
> s:\soft\win-ix86\j2sdk\1.4.0b3\jre
> [...]
>
> BUILD FAILED
>
> H:\dev\java\build.xml:14: Cannot use classic compiler, as it is not
> available A common solution is to set the environment variable
> JAVA_HOME to your jdk directory.
>         at
> org.apache.tools.ant.taskdefs.compilers.Javac12.execute(Javac12.java:96)
>
>         at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:530)
>
>         at org.apache.tools.ant.Task.perform(Task.java:217)
>         at org.apache.tools.ant.Target.execute(Target.java:164)
>         at org.apache.tools.ant.Target.performTasks(Target.java:182)
>         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)
>
> (Note the java.class.path). This happens though:
>
> Mon 03/12/01 18:57 H:/dev/java
> [seb@ART002001] 152 # ls -l
> s:/soft/win-ix86/j2sdk/1.4.0b3/lib/tools.jar
> -rw-r--r--   1 administ None      4822168 Dec  3 14:44
> s:/soft/win-ix86/j2sdk/1.4.0b3/lib/tools.jar
>
> Mon 03/12/01 18:58 H:/dev/java
> [seb@ART002001] 154 # jar tvf
> s:/soft/win-ix86/j2sdk/1.4.0b3/lib/tools.jar
> sun/tools/javac/Main.class
>  13253 Sat Oct 20 01:16:08 PDT 2001 sun/tools/javac/Main.class
>
> So i don't really understand what's wrong here, unless Ant 1.4.1 has
> an issue with the Sun 1.4 beta 3 SDK?
>
> Any help would be appreciated!
>
> Sebastien.
>