/** {@inheritDoc} */ @Override protected boolean run(Commandline cmd, ProjectComponent log) throws BuildException { ExecuteJava ej = new ExecuteJava(); Class<?> c = getN2aClass(); if (c == null) { throw new BuildException( "Couldn't load Kaffe's Native2Ascii class"); } cmd.setExecutable(c.getName()); ej.setJavaCommand(cmd); ej.execute(log.getProject()); // otherwise ExecuteJava has thrown an exception return true; }
/** * Executes the given classname with the given arguments as it * were a command line application. * @param command CommandlineJava. */ private void run(CommandlineJava command) throws BuildException { try { ExecuteJava exe = new ExecuteJava(); exe.setJavaCommand(command.getJavaCommand()); exe.setClasspath(command.getClasspath()); exe.setSystemProperties(command.getSystemProperties()); exe.setPermissions(perm); exe.setTimeout(timeout); redirector.createStreams(); exe.execute(getProject()); redirector.complete(); if (exe.killedProcess()) { throw new BuildException(TIMEOUT_MESSAGE); } } catch (IOException e) { throw new BuildException(e); } }