jMonkeyEngine “An instance of the program cannot access specified user directory”

This is a simple issue and most Linux users can probably figure it out rather quickly. I don’t mean to offend anyone, but the error message is pretty straight-forward when it comes to the problem. However, I’ll explain it to those who run into it and want to know how to fix it. Then again, I may be the only person who runs into this problem. Either way, I’m posting it for anyone who may need it.

The problem stems with the installation of jMonkeyEngine. The installer is a .sh file which which can be executed like so:

1
sh jME3_SDK_Beta-Linux.sh

However, if you are like me, you may have ran it with sudo like this:

1
sudo sh JME3_SDK_Beta-Linux.sh

The good thing about using sudo is that the program will be installed for all users on the machine. I’ve not ran it without sudo to see if it will install for only the user running the installer, but I’m assuming that it will.

After the installation occurs, it asks you if you want to start jMonkeyEngine. If you answer yes, it will start it as root, and it will write it’s hidden users directory in your home directory. The home directory will have root:root as the owner because the program was first started by the root user.

So when you go back and run the program again, it will not have access to the required folder. The solution is to change the owner of the folder. This is accomplished simply by typing this in a terminal while in your home folder (the terminal should open in your home folder automatically, but just to make sure we’ll change directory into it first). In the following example the word “username” should be replace with your actual username.

1
2
cd ~/
chown -R username:username .jmonkeyplatform

You should now be able to open jMonkeyEngine. The -R, for those of you interested, means “recursive”, which will change the owner of all files and folder inside of .jmonkeyplatform, not just the folder itself.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.