ant run

G

gk

i have a root directory.

this root directory has

com.web package and compiled classes and a "lib" directory



c:\ROOT\com\web
c:\ROOT\lib
c:\ROOT\Main.java

i have a java program Main.java at C:\ROOT which imports those
packaged classes .


i want to run this Main.java program.

How do i write my build.xml ?

the below does not work



<java classname="Main">

<classpath>
<pathelement location="lots of jars"/>
<pathelement path="${java.class.path}"/>
</classpath>
</java>
 
W

Wibble

gk said:
i have a root directory.

this root directory has

com.web package and compiled classes and a "lib" directory



c:\ROOT\com\web
c:\ROOT\lib
c:\ROOT\Main.java

i have a java program Main.java at C:\ROOT which imports those
packaged classes .


i want to run this Main.java program.

How do i write my build.xml ?

the below does not work



<java classname="Main">

<classpath>
<pathelement location="lots of jars"/>
<pathelement path="${java.class.path}"/>
</classpath>
</java>
YOu have to compile it first.
 
G

gk

the class has been compiled.
i have used the <javac tag in my build.xml. and it has been
compiled.

how to run the code ?

i have these peoperties.

<property name="src.dir" value="src"/>
<property name="classes.dir" value="classes"/>
<property name="lib.dir" value="lib"/>


what should i do to run a java program ?


in this example from the manual :
-------------------------

<java classname="Main">

<classpath>
<pathelement location="lots of jars"/>
<pathelement path="${java.class.path}"/>
</classpath>
</java>


what is java.class.path ? what should i write in my build.xml for this
?
what is location=? i have lots of jars in the lib directory. how do i
use it here ?


to run a java program in Ant , is it necessary to make JAR first ?


can you please provide a sample example build.xml about running a
java program ?

thank you






i have a lib
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top