Lets say that I have this line of code:
System.out.println("java ZipDirectory.java " + workspace);
This prints out something like
java ZipDirectory.java C:\Users\Dude\Desktop\Stuff
How do I get Java to actually execute the above, instead of just printing it out in console?
Edit: I've tried doing this so far and have yet to be able to get the functoin to run properly.
Runtime.exec("java ZipDirectory " + workspace);
&&
Runtime.getRuntime().exec("java ZipDirectory " + workspace);
For added clarification since I don't really know a whole lot about Java, but here is the method within which I am working:
@Override
public void perform(Run<?, ?> run, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException, IOException {
System.out.println("java ZipDirectory.java " + workspace);
Runtime.getRuntime().exec("java ZipDirectory " + workspace);
run.addAction(new HelloWorldAction(name));
//run.Action(new ZipDirectory.main(workspace))
//ZipDirectory.main( workspace )
listener.getLogger().println("Hello, " + name + "!");
listener.getLogger().println("Workspace: " + workspace);
}