Package com.lingocoder.jar
Class JarTool
- java.lang.Object
-
- com.lingocoder.jar.JarTool
-
public class JarTool extends java.lang.Object
A utility that provides convenience methods for working with Javajar
files 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 ProcessIO
execute(java.lang.String... commands)
Execute a jar file in the JVM.ProcessIO
run(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 thejar
command. That would be telling thejar
command 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-Class
of the jar that will be executed. DO NOT prepend the commands with the neither thejava
command nor the-jar
command. That would be tellingjava
to run itself.- Returns:
- A composite result of the execution.
-
-