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
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Jars | List | No | JAR files or class folders to load; empty for classes of Java itself. | |
| Class name | String | Yes | Full class name, with its package. | |
| Method | String | Yes | Method name; the one whose parameters fit the arguments is used. | |
| Arguments | List | No | Arguments in order; converted to the method's parameter types. | |
| Create instance | Boolean | No | false | Create an object of the class first and call the method on it. |
| Constructor arguments | List | No | Arguments for creating the object. | |
| Java | File | No | Java program to use; the runner's own Java, then java on the PATH, when empty. | |
| Timeout (seconds) | Number | No | 120 | Stop the call after this many seconds. |
| Fail on error | Boolean | No | true | Fail the step when the code throws; when off, the error goes to 'error' and the run goes on. |
Outputs
| Output | Type | What it is |
|---|---|---|
| result | Any | What the method returned (text, numbers, true/false, lists and maps; other objects as text). |
| output | String | What the method printed. |
| error | String | The exception, when fail on error is off. |