I want to start a .NET application (compatible with Mono) from the context of a Java environment.
My guess would be that I'd have to somehow figure out if mono is installed, find the location and start that using the .NET application path as a parameter.
But what is a robust way to do it? Or is there a better way?
Perhaps I should clarify the context: the Java part is running as a plugin in an environment with limited interaction possible, so I would really prefer to find a way without having to need a configuration file or an user-interface.
If you already have .net/mono already installed and you can double click on the exe file and it runs, then you could just use Desktop.open()
As easy as:
Desktop.getDesktop().open(file);
See here for more details: Using the Desktop API in Java SE 6 EDIT
I had to boot my Linux box where I have a mono application and this worked just great:
class Launch {
public static void main( String ... arg ) {
new ProcessBuilder("/usr/bin/myapp").start();
}
}
Repeat, worked just great!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With