I am wondering if there is a safe and easy way to allow ImageJ to update itself by allowing it to replace its ij.jar file with a new one in /usr/share/java? Right now, an error message says "No Write Access: /usr/share/java/ij.jar"
Thanks!
You have two options:
sudo
(or gksudo
, if it is a GUI application). This grants the program the right to modify whatever file it desires, but may also allow it to edit unintended files. This might be a security risk, especially if it contains a bug that might damage your system.The safer option: You modify the access privileges of the single file you want to have updated. That way, your program may run under your normal user account and can not cause more damage than usual. You just have to execute two simple terminal commands:
First, allow all users to modify the file:
sudo chmod o+w /usr/share/java/ij.jar
Then you start your program and let it do the update. Close it again afterwards. Now remove the write permission for all users on the file again:
sudo chmod o-w /usr/share/java/ij.jar
That already was the whole procedure.
sudo chown root:root /usr/share/java/ij.jar
. But it might also be possible that you won't notice any disadvantages. You will only know afterwards...