Run the rmic compiler.
getRmic().log("Using SUN rmic compiler", Project.MSG_VERBOSE);
Commandline cmd = setupRmicCommand();
// Create an instance of the rmic, redirecting output to
// the project log
LogOutputStream logstr = new LogOutputStream(getRmic(),
Project.MSG_WARN);
try {
Class c = Class.forName(RMIC_CLASSNAME);
Constructor cons
= c.getConstructor(new Class[] {OutputStream.class, String.class});
Object rmic = cons.newInstance(new Object[] {logstr, "rmic"});
Method doRmic = c.getMethod("compile",
new Class [] {String[].class});
Boolean ok =
(Boolean) doRmic.invoke(rmic,
(new Object[] {cmd.getArguments()}));
return ok.booleanValue();
} catch (ClassNotFoundException ex) {
throw new BuildException(ERROR_NO_RMIC_ON_CLASSPATH,
getRmic().getLocation());
} catch (Exception ex) {
if (ex instanceof BuildException) {
throw (BuildException) ex;
} else {
throw new BuildException(ERROR_RMIC_FAILED,
ex, getRmic().getLocation());
}
} finally {
try {
logstr.close();
} catch (IOException e) {
throw new BuildException(e);
}
}