0

Is there any way to call a Java method using the ProcessBuilder API?

I wish to execute a Java method using processes only for some reason. Thus, I have written this code so far -

ProcessBuilder p = new ProcessBuilder("java", "--version");
Process proc = p.start();

I know that this would print the current java version on my laptop. I wish to call a Java Method for example, Class1.doAddition() instead of printing the Java version.

Is there any way to do this?

Mick Mnemonic
  • 7,808
  • 2
  • 26
  • 30
Vivek
  • 165
  • 3
  • 9

0 Answers0