• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Classic Compiler error while running ant.

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,
I'm having then following error when i execute my ant command as below.
D:\apache-ant-1.5.2\bin>ant -f afe-build.xml compileall
Buildfile: afe-build.xml
compileall:
[javac] Modern compiler is not available - using classic compiler
[javac] Compiling 53 source files to E:\Telenet-Maintenance\oasis\lib\classe
s
BUILD FAILED
D:\apache-ant-1.5.2\bin\afe-build.xml:99: 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: 1 second
D:\apache-ant-1.5.2\bin>echo %JAVA_HOME%
D:\jdk1.3.1
As you can see, my JAVA_HOME env . variable is properly set. Can anyone throw some light.
Thanks
Vikas
D:\apache-ant-1.5.2\bin>
 
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does your jdk home has a subdirectory \bin? Make sure you have complete sets of lib's etc there too. Sometimes, jdk files can be corrupted. If that's the case, download a new one.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was having a similar problem running ant from within WSAD. I found that I needed to pass
-Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter
as an argument so that it would know where to find the compiler.
Hope this helps!
Mark
[ March 10, 2004: Message edited by: Mark Binau ]
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mark
This was very helpful
 
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mark Binau:
I was having a similar problem running ant from within WSAD. I found that I needed to pass

-Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter

as an argument so that it would know where to find the compiler.



I found this long ago and took it a step further....

<!-- ****************************************************** -->
<!-- Determines whether being run from inside WSAD/Eclipse -->
<!-- and sets properties as needed -->
<!-- ****************************************************** -->
<target name="eclipse" if="eclipse.running">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter" />
</target>

I then added this as a dependency to my build target, i.e.

<!-- **************************************************** -->
<!-- Compiles the source code -->
<!-- **************************************************** -->
<target name="compile" depends="eclipse,init" description="Compiles source code">
<javac destdir="${classes}" debug="true" deprecation="true">
<src path="${src}"/>
</javac>
</target>

I never have to worry about this problem now. And I don't have to explain the problem to anyone else that picks up my projects that contain a build.xml file, either...!
 
Acetylsalicylic acid is aspirin. This could be handy too:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic