Are you better than me? Then please show me my mistakes..
if i run the jar file using java -jar myJar.jar it works fine
and it will NOT work if i use java -jar /opt/myJavaProgram/myJar.jar
Are you better than me? Then please show me my mistakes..
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:That's because . is the directory where the program was started from - /opt/myJavaProgram in your first example, and your home directory (~) in the second.
Are you better than me? Then please show me my mistakes..
Campbell Ritchie wrote:Why are you running your work from /opt rather from a home directory?
Are you better than me? Then please show me my mistakes..
Campbell Ritchie wrote:. . . and what is wrong with keeping your .jar somewhere in /home? Your desktop link should work nicely however.
Are you better than me? Then please show me my mistakes..
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Tim Holloway wrote:Actually, I think there's supposed to be a "working directory" directive for that desktop link file, so that would eliminate the need for the "cd" command in the Exec directive.
Note that "/opt" is supposed to be a shared system directory, so it's not er, optimal, for use as a single-user app.
In fact, if you want multiple users to have the ability to use the same app, you can put the executable in /opt - preferably a subdirectory of /opt, but you should use the Java Preferences system if you need per-user files.
Probably even better would be to put the Java app under /usr/local (or /usr/local/bin*), use Java Preferences for per-user data, and put any common data files under /var/lib. And while you're at it, add a shell script to run the java -jar command so that the Exec is more Linux-friendly.
*Note that there are attempts being made to reduce the number of "bin" directories in Linux, so check current recommended practices in the LSB.
Are you better than me? Then please show me my mistakes..
Don't get me started about those stupid light bulbs. |