I have a Java application that does something like:
public class MyApplication {
public static int main(String[] args) {
System.out.println(System.getProperty("my.property"));
}
}
How do I call this from Groovy such that the Groovy script sets the System property?
You can call Java with the
-Dcommand line parameter:Alternatively, you can call the Java class from within your script without starting a new Java process: