The following command runs correctly in my Linux terminal:
java -Djava.library.path=/home/john/native_so_libraries/linux-64 -cp '/home/john/NetBeansProjects/SendReceive/dist/SendReceive.jar:/home/john/Desktop/Dropbox/Libjitsi_linux_64/*' Main "send"
This command specifies a folder for native .so libraries (via Djava.library.path=/...), an application JAR file named "SendReceive.jar", a folder for JAR libraries (via the -cp classpath option), and also a main class containing a main method to run, a class called "Main". It has as one command line argument surrounded by quotation marks, the "send" argument. This command works and runs a Java process from the terminal, but I cannot figure out how to get it to work with Runtime.getRuntime().exec from another process.
Note that I am doing my best to follow the instructions provided in this tutorial: http://www.javaworld.com/article/2071275/core-java/when-runtime-exec---won-t.html?page=2 - meaning that I am using threads to consume the standard input and standard error streams from the process. Still, the process won't start when I make that terminal command into a string like so:
Process process = Runtime.getRuntime().exec("java -Djava.library.path=/home/john/native_so_libraries/linux-64 -cp '/home/john/NetBeansProjects/SendReceive/dist/SendReceive.jar:/home/john/Desktop/Dropbox/Libjitsi_linux_64/*' Main \"send\"");
How do I make this command run via Runtime.getRuntime().exec?