Some question regarding this error message ("Modern compiler not available"): How exactly does Ant determine no 'modern' compiler is available? My compiler _is_ modern, and the error message and debugging info don't provide me enough info to correct the problem.

I have this error on my Win2k box, with several versions of Ant, several versions of JDK's, each time with a correct JAVA_HOME and a lib/tools.jar in it.

More detailed info below.

thanks in advance,


[Detailed info for JDK 1.3.1_01 / Ant 1.4 (also tried other combinations with JDK 1.4.1 and Ant 1.4.1): ]

D:\temp\test>echo %JAVA_HOME%

D:\temp\test>echo %CLASSPATH%

D:\temp\test>rem (also tried without this classpath)

D:\temp\test>dir %CLASSPATH%
 Volume in drive D is soft
 Volume Serial Number is D478-F8F7

 Directory of d:\soft\win-ix86\jdk\1.3.1_01\lib

08/08/2001  01:14p           4,710,905 tools.jar
               1 File(s)      4,710,905 bytes
               0 Dir(s)     592,420,864 bytes free

 Volume in drive D is soft
 Volume Serial Number is D478-F8F7

 Directory of D:\temp\test

12/04/2001  05:25p      <DIR>          .
12/04/2001  05:25p      <DIR>          ..
12/04/2001  05:05p                 303 build-compile.xml
12/04/2001  04:54p                 250 build-compile.xml~
12/04/2001  05:21p              14,512 out
12/04/2001  05:24p              10,693 out2.bat
12/04/2001  05:28p               9,224 stdout
12/04/2001  03:39p                   7 test.class
12/04/2001  03:39p                  23
               7 File(s)         35,012 bytes
               2 Dir(s)     592,420,864 bytes free

D:\temp\test>type build-compile.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="test-compile" default="compile" basedir=".">

  <target name="compile">
    <javac srcdir="." destdir="." debug="on">
      <include name="*.java"/>


D:\temp\test>ant -f build-compile.xml
Buildfile: build-compile.xml

    [javac] Modern compiler is not available - using classic compiler
    [javac] Compiling 1 source file to D:\temp\test


D:\temp\test\build-compile.xml:5: Cannot use classic compiler, as it is not avai
lable A common solution is to set the environment variable JAVA_HOME to your jdk

Total time: 0 seconds

D:\temp\test>ant -debug -f build-compile.xml
Ant version 1.4 compiled on September 3 2001
Buildfile: build-compile.xml
Setting project property: -> 1.3
Detected Java version: 1.3 in: d:\soft\win-ix86\jdk\1.3.1_01\jre
Detected OS: Windows 2000
 +User task: tar
 +User task: fail
 +User task: uptodate
 +User task: dependset
 +User task: java
 +User task: execon
 +User task: echo
 +User task: chmod
 +User task: javadoc2
 +User task: deltree
 +User task: cvs
 +User task: tstamp
 +User task: pathconvert
 +User task: unjar
 +User task: patch
 +User task: mail
 +User task: gzip
 +User task: copy
 +User task: filter
 +User task: jar
 +User task: unzip
 +User task: rename
 +User task: copyfile
 +User task: gunzip
 +User task: antcall
 +User task: taskdef
 +User task: mkdir
 +User task: sql
 +User task: replace
 +User task: ear
 +User task: ant
 +User task: style
 +User task: fixcrlf
 +User task: sequential
 +User task: genkey
 +User task: zip
 +User task: condition
 +User task: antstructure
 +User task: javac
 +User task: typedef
 +User task: available
 +User task: cvspass
 +User task: move
 +User task: signjar
 +User task: property
 +User task: unwar
 +User task: touch
 +User task: get
 +User task: javadoc
 +User task: record
 +User task: untar
 +User task: delete
 +User task: copydir
 +User task: war
 +User task: parallel
 +User task: exec
 +User task: apply
 +User task: sleep
 +User task: rmic
 +User datatype: fileset
 +User datatype: patternset
 +User datatype: filterset
 +User datatype: filelist
 +User datatype: description
 +User datatype: path
 +User datatype: mapper
Setting project property: -> Java(TM) 2 Runtime Environment, S
tandard Edition
Setting project property: sun.boot.library.path -> d:\soft\win-ix86\jdk\1.3.1_01
Setting project property: java.vm.version -> 1.3.1_01
Setting project property: java.vm.vendor -> Sun Microsystems Inc.
Setting project property: java.vendor.url ->
Setting project property: path.separator -> ;
Setting project property: -> Java HotSpot(TM) Client VM
Setting project property: file.encoding.pkg ->
Setting project property: -> Java Virtual Machine Spe
Setting project property: user.dir -> D:\temp\test
Setting project property: java.runtime.version -> 1.3.1_01
Setting project property: java.awt.graphicsenv -> sun.awt.Win32GraphicsEnvironme
Setting project property: os.arch -> x86
Setting project property: -> D:\TEMP\
Setting project property: line.separator ->

Setting project property: java.vm.specification.vendor -> Sun Microsystems Inc.
Setting project property: java.awt.fonts ->
Setting project property: -> Windows 2000
Setting project property: ant.home -> d:\soft\win-ix86\jakarta-ant-1.4\bin\\..
Setting project property: java.library.path -> d:\soft\win-ix86\jdk\1.3.1_01\bin
Setting project property: -> Java Platform API Specifica
Setting project property: java.class.version -> 47.0
Setting project property: os.version -> 5.0
Setting project property: user.home -> C:\Documents and Settings\seb
Setting project property: user.timezone ->
Setting project property: java.awt.printerjob ->
Setting project property: file.encoding -> Cp1252
Setting project property: java.specification.version -> 1.3
Setting project property: java.class.path -> d:\soft\win-ix86\jdk\1.3.1_01\lib\t
Setting project property: -> seb
Setting project property: java.vm.specification.version -> 1.0
Setting project property: java.home -> d:\soft\win-ix86\jdk\1.3.1_01\jre
Setting project property: user.language -> en
Setting project property: java.specification.vendor -> Sun Microsystems Inc.
Setting project property: awt.toolkit ->
Setting project property: -> mixed mode
Setting project property: java.version -> 1.3.1_01
Setting project property: java.ext.dirs -> d:\soft\win-ix86\jdk\1.3.1_01\jre\lib
Setting project property: sun.boot.class.path -> d:\soft\win-ix86\jdk\1.3.1_01\j
Setting project property: java.vendor -> Sun Microsystems Inc.
Setting project property: file.separator -> \
Setting project property: java.vendor.url.bug ->
Setting project property: -> UnicodeLittle
Setting project property: sun.cpu.endian -> little
Setting project property: user.region -> US
Setting project property: sun.cpu.isalist -> pentium i486 i386
Setting ro project property: ant.version -> Ant version 1.4 compiled on Septembe
r 3 2001
Setting ro project property: ant.file -> D:\temp\test\build-compile.xml
parsing buildfile D:\temp\test\build-compile.xml with URI = file:D:/temp/test/bu
Setting ro project property: -> test-compile
Adding reference: test-compile ->
Setting project property: basedir -> D:\temp\test
Project base dir set to: D:\temp\test
 +Target: compile
   +Task: javac
Build sequence for target `compile' is [compile]
Complete build sequence is [compile]

FileSet: Setup file scanner in dir D:\temp\test with patternSet{ includes: [*.ja
va] excludes: [] }
    [javac] added as D:\temp\test\test.class is outdated.
    [javac] Modern compiler is not available - using classic compiler
    [javac] Compiling 1 source file to D:\temp\test
    [javac] Using classic compiler
    [javac] Compilation args: -d D:\temp\test -classpath D:\temp\test;D:\soft\wi
4\lib\ant.jar -sourcepath D:\temp\test -g
    [javac] File to be compiled:


D:\temp\test\build-compile.xml:5: Cannot use classic compiler, as it is not avai
lable A common solution is to set the environment variable JAVA_HOME to your jdk

Total time: 2 seconds