Skip to main content

Call Java method

Load JAR files and call a static method of a class, or create an object and call one of its methods, in a separate Java process.

Command in the .NET, Java and COM toolkit · id ooa.dotnet/call_java_method · 9 inputs (2 required), 3 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
JarsListNoJAR files or class folders to load; empty for classes of Java itself.
Class nameStringYesFull class name, with its package.
MethodStringYesMethod name; the one whose parameters fit the arguments is used.
ArgumentsListNoArguments in order; converted to the method's parameter types.
Create instanceBooleanNofalseCreate an object of the class first and call the method on it.
Constructor argumentsListNoArguments for creating the object.
JavaFileNoJava program to use; the runner's own Java, then java on the PATH, when empty.
Timeout (seconds)NumberNo120Stop the call after this many seconds.
Fail on errorBooleanNotrueFail the step when the code throws; when off, the error goes to 'error' and the run goes on.

Outputs​

OutputTypeWhat it is
resultAnyWhat the method returned (text, numbers, true/false, lists and maps; other objects as text).
outputStringWhat the method printed.
errorStringThe exception, when fail on error is off.