Is it possible to run a java class in a batch file with a main method inside, changing the return type of the method from "void" to another type, and get the return value in batch file?
I mean something similar to the following:
Java class:
public class Main{
public static String main(String[] args) {
public String returnValue;
// code to execute...
return returnValue;
}
}
Batch file:
...
set RETURNVALUE = ""
//call "java com.test.Main" and store return value in RETURNVALUE variable
...
I need to make some checks in the java class, and then execute the subsequent instructions in batch file according to the result given by the java class.
Any help will be appreciated