|
|
|
|
|
|
Re: Export runnable jar files wizard - library handling (Indigo) [message #882588 is a reply to message #882363] |
Wed, 06 June 2012 15:49  |
Eclipse User |
|
|
|
I found the problem! (Have yet to implement the solution!)
Here's my first attempt at a simpler test where test is a shell script that creates a file.
String newCommand = "/home/programmer/var/jars/test" };
Process p;
try {
p = Runtime.getRuntime().exec(command);
} catch (IOException e1) {
e1.printStackTrace();
}
This doesn't work because there are no environmental paths. In addition the command string is parsed into separate strings at spaces and that might destroy the logic.
This works!
// path to sh is included (and the string are broken by me)
String [] newCommand = {"/bin/sh", "/home/programmer/var/jars/test" };
Process p;
try {
p = Runtime.getRuntime().exec(command);
} catch (IOException e1) {
e1.printStackTrace();
}
Breaking up the command string into an array of strings is overkill for this simple test.
I need to include the full path, to java if I can find it. This could be a pain since it needs to be the same for all computers but perhaps it can be computed. Here is what I was doing that didn't work at all.
// my computed command String
java -jar /home/programmer/var/jars/ImageDisplay.jar "/media/sdb1/images/PR-640/PR-640_0004.raw"
I'll need to prepend the path to java to "java" and distribute the strings into a string array. At least I now understand and here's my reference:
http://www.ensta-paristech.fr/~diam/java/online/io/javazine.html
Thanks for your help.
|
|
|
Powered by
FUDForum. Page generated in 0.04244 seconds