Package com.lingocoder.jar
Class JarTool
- java.lang.Object
-
- com.lingocoder.jar.JarTool
-
public class JarTool extends java.lang.ObjectA utility that provides convenience methods for working with Javajarfiles similar to the way they would be used on the command line.
-
-
Constructor Summary
Constructors Constructor Description JarTool()Create an instance with default state.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProcessIOexecute(java.lang.String... commands)Execute a jar file in the JVM.ProcessIOrun(java.lang.String... commands)Run the jar tool.
-
-
-
Method Detail
-
run
public ProcessIO run(java.lang.String... commands)
Run the jar tool. Not to be confused with "executing a jar file". There's a different, more appropriately-named method for that.- Parameters:
commands- The commands the jar tool will run. DO NOT prepend the commands with thejarcommand. That would be telling thejarcommand to run itself.- Returns:
- A composite result of the run.
-
execute
public ProcessIO execute(java.lang.String... commands)
Execute a jar file in the JVM. Not to be confused with "running the jar tool". There's a different, more appropriately-named method for that.- Parameters:
commands- The commands that will be passed to theMain-Classof the jar that will be executed. DO NOT prepend the commands with the neither thejavacommand nor the-jarcommand. That would be tellingjavato run itself.- Returns:
- A composite result of the execution.
-
-