I wanted to create runnable jar of Jitsi, one of the most popular SIP communicator. So, I have packaged Jitsi as a runnable jar. It can be used when this runnable jar is passed appropriate VM arguments, like:
-Dfelix.config.properties=file:lib/felix.client.run.properties
-Djava.util.logging.config.file=lib/logging.properties
-Dnet.java.sip.communicator.SC_HOME_DIR_NAME=Jitsi-dev
My Main class which invoke this runnable jar with those parameters looks like :
public class Main {
public static void main(String[] args) {
try {
Process p = Runtime.getRuntime().exec("java",
"-Dfelix.config.properties=file:lib/felix.client.run.properties",
"-Djava.util.logging.config.file=lib/logging.properties",
"-Dnet.java.sip.communicator.SC_HOME_DIR_NAME=Jitsi-dev,
"-jar", "jitsi.jar");
} catch (IOException e) {
e.printStackTrace();
}
}
}
Of course in my jar you can also find those two properties files (felix.client.run.properties and logging.properties) in lib folder and also previously packed Jitsi in jitsi.jar. Unfortunately, I received an error that the config.properties via command line is not loaded. But when I make a shell script whuch runs jitsi.jar with the same parameters, I am able to run Jitsi. What is wrong with this above code ?