• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Eclips and Ant

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I down loaded eclipse-SDK-3.0.2-win32, and purchased the Eclipse Cookbook, 2004 ISBN: 0-596-00710-8. Example files are at
http://examples.oreilly.com/eclipseckbk/

Chapter 7 �Eclipse and Ant� develops a project called AntProject, which I am unable to get to work. Since the figures in the chapter don�t match the dialogs in Eclipse, I suspect the chapter needs to be updated to match the new Eclipse SDK.

I imported the example from Ch 07, which I downloaded from the Eclipse website, and got the following error message when I ran it:

Buildfile: C:\Documents and Settings\Administrator\Local Settings\Temp\eclipse-SDK-3.0.2-win32\eclipse\workspace\AntProject\build.xml
Initialization:
[delete] Deleting directory C:\Documents and Settings\Administrator\Local Settings\Temp\eclipse-SDK-3.0.2-win32\eclipse\workspace\AntProject\bin
[mkdir] Created dir: C:\Documents and Settings\Administrator\Local Settings\Temp\eclipse-SDK-3.0.2-win32\eclipse\workspace\AntProject\bin
[mkdir] Created dir: C:\Documents and Settings\Administrator\Local Settings\Temp\eclipse-SDK-3.0.2-win32\eclipse\workspace\AntProject\bin\lib
Compilation:
[javac] Compiling 1 source file to C:\Documents and Settings\Administrator\Local Settings\Temp\eclipse-SDK-3.0.2-win32\eclipse\workspace\AntProject\bin
BUILD FAILED: C:\Documents and Settings\Administrator\Local Settings\Temp\eclipse-SDK-3.0.2-win32\eclipse\workspace\AntProject\build.xml:20: Compiler Adapter 'org.eclipse.jdt.core.JDTCompilerAdapter' can't be found.
Total time: 1 second

How should I change the build.xml file below to get the program to work?

<?xml version="1.0" encoding="UTF-8"?>
<project name="AntProject" default="Build" basedir=".">

<property name="build.compiler"
value="org.eclipse.jdt.core.JDTCompilerAdapter" />
<property name="srcDir" location="src" />
<property name="binDir" location="bin" />
<property name="jarDir" location="${binDir}/lib" />
<property name="jarFile" location="${jarDir}/AntProject.jar" />

<target name="Initialization">
<delete dir="${binDir}" />
<delete dir="${jarDir}" />
<mkdir dir="${binDir}" />
<mkdir dir="${jarDir}" />
</target>

<target name="Compilation" depends="Initialization">
<javac srcdir="${srcDir}"
destdir="${binDir}" />
</target>

<target name="Jar" depends="Initialization, Compilation">
<jar destfile="${jarFile}" basedir="${binDir}" />
</target>

<target name="Build" depends="Initialization, Compilation, Jar">
<echo message="Ant is building your project." />
</target>

</project>

Thank you in advance,

Ed
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ed,

Not sure if you've resolved your problem or not b/c it's been several days since you posted.

If so, great!

If not, you have two options...

1.) You can comment out the property that sets build.compiler, Ant will then use the JDK that eclipse is running under
2.) If you really want to use that JDTCompilerAdapter, follow these steps:
  • Click Window, Preferences on the menu bar
  • Expand the Ant item on the left and click on Runtime
  • With the Classpath tab selected, click on Ant Home Entries
  • Click the Add External Jars button
  • Browse to your eclipse installation (maybe c:\eclipse), then open the Plugins directory
  • Find the directory org.eclipse.jdt.core_3.0.1 and open it
  • Select both jdtCompilerAdapter.jar and jdtcore.jar and click Open
  • Click OK and your build script should now run


  • Good luck!
     
    reply
      Bookmark Topic Watch Topic
    • New Topic