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.
Campbell Ritchie wrote:. . . and what is wrong with keeping your .jar somewhere in /home? Your desktop link should work nicely however.
Campbell Ritchie wrote:Why are you running your work from /opt rather from a home directory?
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.
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
Rob Spoor wrote:There is no such thing as a Class object for a generic type. There is only Response.class for the raw Response type. However, you can still do what you want with a little bit of cheating:
You can't cast Response.class directly to a Class<Response<RESULT>>, but the intermediate cast solves that.[/quote
Thank you very much Rob!
You're life saver
Campbell Ritchie wrote:That is no different from <T> String or <T> int before the method name. It is a generic method and you can read about it in the Java® Tutorials.
Campbell Ritchie wrote: . . .
So, how are you going to use ZERO in class Bar. You either have to use the old‑fashioned technique of writing Foo.ZERO, or write plain simple ZERO, which requires a static import.
At least I think it does; I have never tried. Try it and tell us what happens.
Campbell Ritchie wrote:You would still need a static import even if the classes are in the same package.