users@jaxb.java.net

how to call xjc from ant on Mac ?

From: Andy Davidson <andy_davidson_at_apple.com>
Date: Wed, 28 Dec 2011 12:11:19 -0800

Hi

I am using eclipse on a Mac, and need to be able to run xjc as part of my ant build process. I found

http://jaxb.java.net/nonav/2.1.10/docs/xjcTask.html

"The jaxb-xjc.jar file contains the XJCTask.class file, which allows the XJC binding compiler to be invoked from the Ant build tool. To use XJCTask, include the following statement in your build.xml file:

<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
  <classpath>
    <fileset dir="path/to/jaxb/lib" includes="*.jar" />
  </classpath>
</taskdef>"

Any idea where I can find the required jar files?

The Java distribution on Mac does not contain jar files?

$ ant -version
Apache Ant(TM) version 1.8.2 compiled on October 14 2011
$

$ xjc -version
xjc version "JAXB 2.1.10 in JDK 6"
JavaTM Architecture for XML Binding(JAXB) Reference Implementation, (build JAXB 2.1.10 in JDK 6)
$

$ file `which xjc`
/usr/bin/xjc: Mach-O universal binary with 3 architectures
/usr/bin/xjc (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/xjc (for architecture i386): Mach-O executable i386
/usr/bin/xjc (for architecture ppc7400): Mach-O executable ppc
$
$ java -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)

thanks in advance

Andy