Skip to content

Instantly share code, notes, and snippets.

@dreiss
Created May 14, 2009 00:01
Show Gist options
  • Save dreiss/111391 to your computer and use it in GitHub Desktop.
Save dreiss/111391 to your computer and use it in GitHub Desktop.
<?xml version="1.0"?>
<project name="test" default="run" basedir=".">
<property environment="env" />
<path id="cpath">
<pathelement path="${env.CLASSPATH}" />
<pathelement location="build" />
</path>
<target name="init" >
<mkdir dir="build" />
</target>
<target name="compile" depends="init" >
<javac fork="true" debug="true" srcdir="src" destdir="build" classpathref="cpath" />
</target>
<target name="run" depends="compile">
<java fork="true" classname="test" classpathref="cpath" failonerror="true" />
</target>
<target name="clean">
<delete dir="build" />
</target>
</project>
$ CLASSPATH=/usr/share/java/commons-lang-2.4.jar ant -v
Apache Ant version 1.7.1 compiled on November 10 2008
Buildfile: build.xml
Detected Java version: 1.6 in: /usr/lib/jvm/java-6-openjdk/jre
Detected OS: Linux
parsing buildfile /home/dreiss/javatest/build.xml with URI = file:/home/dreiss/javatest/build.xml
Project base dir set to: /home/dreiss/javatest
[antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found.
[property] Loading Environment env.
Build sequence for target(s) `run' is [init, compile, run]
Complete build sequence is [init, compile, run, clean, ]
init:
[mkdir] Created dir: /home/dreiss/javatest/build
compile:
[javac] test.java added as test.class doesn't exist.
[javac] Compiling 1 source file to /home/dreiss/javatest/build
[javac] Using external javac compiler
[javac] Compilation arguments:
[javac] '-d'
[javac] '/home/dreiss/javatest/build'
[javac] '-classpath'
[javac] '/home/dreiss/javatest/build:/usr/share/java/commons-lang-2.4.jar:/usr/share/ant/lib/ant-launcher.jar:/usr/share/java/xmlParserAPIs.jar:/usr/share/java/xercesImpl.jar:/usr/share/ant/lib/ant-javamail.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-apache-bsf.jar:/usr/share/ant/lib/ant-jsch.jar:/usr/share/ant/lib/ant-commons-net.jar:/usr/share/ant/lib/ant-apache-bcel.jar:/usr/share/ant/lib/ant-swing.jar:/usr/share/ant/lib/ant-junit.jar:/usr/share/ant/lib/ant-apache-log4j.jar:/usr/share/ant/lib/ant-jmf.jar:/usr/share/ant/lib/ant-trax.jar:/usr/share/ant/lib/ant-jdepend.jar:/usr/share/ant/lib/ant-nodeps.jar:/usr/share/ant/lib/ant-apache-regexp.jar:/usr/share/ant/lib/ant-commons-logging.jar:/usr/share/ant/lib/ant-antlr.jar:/usr/share/ant/lib/ant-apache-oro.jar:/usr/share/ant/lib/ant-apache-resolver.jar:/usr/lib/jvm/java-6-openjdk/lib/tools.jar'
[javac] '-sourcepath'
[javac] '/home/dreiss/javatest/src'
[javac] '-g'
[javac]
[javac] The ' characters around the executable and arguments are
[javac] not part of the command.
[javac] File to be compiled:
[javac] /home/dreiss/javatest/src/test.java
run:
[java] Executing '/usr/lib/jvm/java-6-openjdk/jre/bin/java' with arguments:
[java] '-classpath'
[java] '/usr/share/java/commons-lang-2.4.jar:/home/dreiss/javatest/build'
[java] 'test'
[java]
[java] The ' characters around the executable and arguments are
[java] not part of the command.
BUILD SUCCESSFUL
Total time: 1 second
import org.apache.commons.lang.mutable.MutableInt;
public class test {
public static void main(String args[]) {
new MutableInt(0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment