In java, we can execute a jar in couple of ways. one of the easiest way is to use the Runtime exec method.

The Code is as follows

Runtime.getRuntime().exec( “cmd.exe java -jar solr.jar” );

The other way is using ClassLoader

Advertisement