To make my program a bit more user friendly and easy to update, when it installs it creates a link to the .jar file is on the desktop.
The problem is- The file is not marked as executable, so the user would have to find a hidden directory and mark the jar file as executable. Blech.
I tried using:
Runtime.getRuntime().exec(new String[]{"sudo","chmod","+x",home+"/"+dir+"/DevChat.jar"});
, which, foresee-ably, requested the user’s password which went without reply.
So is there any way I could
A) Give runtime the user’s password after prompting the user for it,
B) Make the link run the command “java -jar blahblahblah.jar”, or
C) Write an install script that marks the file as executable?
You don’t need to be root to change the permissions of a filesystem object you own.