The maven-antrun-plugin runs ant with JAVA_HOME set to the jre subdirectory of the JDK, even if the JAVA_HOME for the overall run is a JDK.

 There is documentation elsewhere about how to create a dependency at the project level for the JDK's tools.jar, but this does not help out antrun, which is a plugin.

 The following profile does the job. The '..' in the path hauls up past the 'jre' directory to the lib directory.

The present author got into this pickle by building out a project on a Mac, where there is no separate tools.jar, and then having the resulting build fail on a hudson instance on Linux.

  <profiles>
        <profile>
            <id>tools.jar</id>
            <activation>
                <property>
                    <name>java.vendor</name>
                    <value>Sun Microsystems Inc.</value>
                </property>
            </activation>
            <build>
              <plugins>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <dependencies>
                  <dependency>
                    <groupId>com.sun</groupId>
                    <artifactId>tools</artifactId>
                    <version>1.5.0</version>
                    <scope>system</scope>
                    <systemPath>${java.home}/../lib/tools.jar</systemPath>
                  </dependency>
                </dependencies>
              </plugin>
              </plugins>
            </build>
        </profile>