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...!