ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laurel A. Williams" <>
Subject basic hello world classpath problem
Date Mon, 16 Apr 2001 13:26:01 GMT
Hello all,

Sorry to ask something so basic but I just can't seem to get past
the original classpath problem...a simple hello class which
cannot be found according to the build.xml. Perhaps when
someone solves this problem, it  could be added as the "hello world"
example in the manual <grin>.

Summary: class hello located on windows machine in c:\hello
Very simple build.xml which compiles using javac but does
not run (java) due to "main class not found"
What am I missing?

Details of build.xml:
<project name="hello" default="run" basedir="c:\hello">

  <!-- set global properties for this build -->
  <property name="src" value="c:\hello"/>
  <property name="build" value="c:\hello"/>
  <property name="classpath" value="c:\hello"/>
  <property name="mainclass" value="hello.class"/>

  <target name="run" depends="compile">
    <!-- run the java code main -->
    <java classname="${mainclass}">
      <pathelement path="${classpath}"/>

  <target name="compile">
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}" destdir="${build}"/>


Details of hello:
public class hello
    public static void main(String args[])


Details of error:
C:\hello\build.xml:11: Could not find hello.class. Make sure you have it

in your classpath

View raw message