Hello,
I am trying to run Ant from within a java application
as follows.
Project project = new Project();
File buildFile = new File(beansDir, "build.xml");
project.setUserProperty("ant.file",
buildFile.getAbsolutePath());
project.setUserProperty("ant.version",
Main.getAntVersion());
project.setUserProperty("name", "mdd-ejb");
project.setUserProperty("version", "0.1");
project.setBaseDir(new File(beansDir));
project.addBuildListener(new DefaultLogger());
project.init();
ProjectHelper.configureProject(project, buildFile);
project.executeTarget("build");
My build file has a compile target
<target name="compile" depends="prepare,ejbdoclet">
<javac destdir="${classes.dir}"
debug="true"
deprecation="true"
optimize="true"
compiler="javac1.4"
source="1.4">
<classpath refid="compile.classpath"/>
<src path="${src.dir}"/>
</javac>
</target>
This target fails whenever I run my code saying that
it was unable to find a JVM. All other targets
(ejbdoclet - which creates the home/remote interfaces
for an ejb) work properly.
Exception occurred during event dispatching:
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
at org.apache.tools.ant.taskdefs.......
I do have a JAVA_HOME env var set. I have even tried
putting an "executable" arg to the javac tag pointing
to the javac executable. I still get the same problem.
Any help would be really appreciated.
Cheers,
Rohit.
=====
Rohit Mathur
[EMAIL PROTECTED]
Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]