I have a program that needs to access a file in my home directory.
Ubuntu will not allow this to happen due to the program not having root privileges. At first I ran this java command (which wouldn't work because the program did not have permission to access the files):
java -jar this.jar
The program was unable to detect the file I needed it to. The path that the program told me that it used was
/home/myhome/directory. This path was correct.
But then the program needed root privileges to actually access that file so I tried:
sudo java -jar this.jar
Then the directory that the program tried to access was
/root/directory this is the problem that I am having.
Is there any way that I can run a program as root with the directory the program views as the
home directory being the
/home directory instead of the