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?