|
|
@@ -102,10 +102,12 @@ public class Java extends Task { |
|
|
*/ |
|
|
*/ |
|
|
public int executeJava() throws BuildException { |
|
|
public int executeJava() throws BuildException { |
|
|
String classname = cmdl.getClassname(); |
|
|
String classname = cmdl.getClassname(); |
|
|
|
|
|
|
|
|
if (classname == null) { |
|
|
|
|
|
|
|
|
if (classname == null && cmdl.getJar() == null) { |
|
|
throw new BuildException("Classname must not be null."); |
|
|
throw new BuildException("Classname must not be null."); |
|
|
} |
|
|
} |
|
|
|
|
|
if (!fork && cmdl.getJar() != null){ |
|
|
|
|
|
throw new BuildException("Cannot execute a jar in non-forked mode. Please set fork='true'. "); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (fork) { |
|
|
if (fork) { |
|
|
log("Forking " + cmdl.toString(), Project.MSG_VERBOSE); |
|
|
log("Forking " + cmdl.toString(), Project.MSG_VERBOSE); |
|
|
@@ -152,10 +154,23 @@ public class Java extends Task { |
|
|
createClasspath().setRefid(r); |
|
|
createClasspath().setRefid(r); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* set the jar name... |
|
|
|
|
|
*/ |
|
|
|
|
|
public void setJar(File jarfile) throws BuildException { |
|
|
|
|
|
if ( cmdl.getClassname() != null ){ |
|
|
|
|
|
throw new BuildException("Cannot use 'jar' and 'classname' attributes in same command."); |
|
|
|
|
|
} |
|
|
|
|
|
cmdl.setJar(jarfile.getAbsolutePath()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Set the class name. |
|
|
* Set the class name. |
|
|
*/ |
|
|
*/ |
|
|
public void setClassname(String s) { |
|
|
|
|
|
|
|
|
public void setClassname(String s) throws BuildException { |
|
|
|
|
|
if ( cmdl.getJar() != null ){ |
|
|
|
|
|
throw new BuildException("Cannot use 'jar' and 'classname' attributes in same command"); |
|
|
|
|
|
} |
|
|
cmdl.setClassname(s); |
|
|
cmdl.setClassname(s); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|