Class JarCommandLine
java.lang.Object
org.apache.commons.exec.CommandLine
org.wildfly.qa.tooling.processexecution.JarCommandLine
public class JarCommandLine
extends org.apache.commons.exec.CommandLine
CommandLine abstraction for executing JAR files.
This class provides a convenient way to create a CommandLine for running JAR files
with proper validation and java binary resolution.
-
Constructor Summary
ConstructorsConstructorDescriptionJarCommandLine(Path jar) Create a new JarCommandLine with default java binary from java.home system property.JarCommandLine(Path javaBinary, Path jar) Create a new JarCommandLine with custom java binary and JAR file. -
Method Summary
Methods inherited from class org.apache.commons.exec.CommandLine
addArgument, addArgument, addArguments, addArguments, addArguments, addArguments, getArguments, getExecutable, getSubstitutionMap, isFile, parse, parse, setSubstitutionMap, toString, toStrings
-
Constructor Details
-
JarCommandLine
Create a new JarCommandLine with custom java binary and JAR file.- Parameters:
javaBinary- path to the java binary to usejar- path to the JAR file to execute- Throws:
IllegalArgumentException- if javaBinary or jar doesn't exist or is not a regular file
-
JarCommandLine
Create a new JarCommandLine with default java binary from java.home system property.- Parameters:
jar- path to the JAR file to execute- Throws:
IllegalArgumentException- if jar doesn't exist or is not a regular file
-