|
Re: Export Runnable JAR file [message #835794 is a reply to message #835787] |
Tue, 03 April 2012 17:22 |
John Klein Messages: 5 Registered: April 2012 |
Junior Member |
|
|
I don't know if this is related or not, but bothers me non-the-less..
When I go to Run->Run Configurations, is shows one configuration and it's under Java Applications.. But, it shows the Name as "ShiftMeter (1)".
If I try to change to the name to "ShiftMeter", it says the name already exists.
This confuses me as I only have one project and that one project only has one Run Configuration.
Could this be part of the issue? And how do I fix it?
Update:
On the duplicate name thingy, nevermind.. I found an option that was filtering it. It was to a previous project that I had deleted.. But I still have the problem in the OP.
[Updated on: Tue, 03 April 2012 17:26] Report message to a moderator
|
|
|
|
|
|
|
|
Re: Export Runnable JAR file [message #880212 is a reply to message #835829] |
Fri, 01 June 2012 16:27 |
Robert Lockwood Messages: 45 Registered: October 2010 Location: Riverside, CA, USA |
Member |
|
|
I have a similar problem. I've created a run-able jar Using the Eclipse Export wizard and then do chmod a+x *.jar
When I access the exported jar using the Ubuntu file "explorer" and choose "Open with Java JDK 3.6 Runtime" (or something like that) the code is executed.
it also works I use terminal and type:
java -jar /home/programmer/var/jars/ImageDisplay.jar "/media/sdb1/images/PR-640/PR-640_0003.raw"
But with this code in another class nothing happens:
String command = "java -jar /home/programmer/var/jars/ImageDisplay.jar " + "\""
+ ifl[index] + "\"";
Tell.sendMessage("Execute: " + command); // prints message
Process p;
try {
p = Runtime.getRuntime().exec(command);
} catch (IOException e1) { // TODO Auto-generated catch block
e1.printStackTrace();
}
The command string that is created I print out and it is:
java -jar /home/programmer/var/jars/ImageDisplay.jar "/media/sdb1/images/PR-640/PR-640_0003.raw"
[Updated on: Fri, 01 June 2012 16:28] Report message to a moderator
|
|
|
Re: Export Runnable JAR file [message #880344 is a reply to message #880212] |
Fri, 01 June 2012 21:59 |
Eclipse User |
|
|
|
Hi,
It probably all depends on the process that is executing the java that
the Runtime.exec() is called in. If the process was started with an
explicit java (i.e. with a fully qualified java) and the process's
environment didn't have that java on the path variable (or whatever the
variable is in Linux) then it wouldn't find just java. It would need to
be fully qualified path to the java file.
Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.04049 seconds