running as root removes all settings and licenses

Hello,

We have an application that needs to bind to a port on OSX that requires root priveleges so I have been running /Applications/IntelliJ IDEA 14.app/Contents/MacOS/idea as root using sudo.

When I run it as root using sudo, it asks me for my license and acts as if it is a fresh install with no settings.

When I run idea normally it recognises my license and configuration settings.

Is there any way to run idea as root and recognise all my licenses and settings from my non-root user?

Thanks,
John

2 comments
Comment actions Permalink

By default, IDEA uses the a sub-directory in the user's home directory for storing settings, including the license. So when you are running as root, it using root's home directory rather than yours. Thus it sees it as a "new installation". On windows and Linux, and I assume Mac as well, you can change this behavior by editing the idea.properties file located at {intellij-idea-installation-dir}/bin/idea.properties In that file, modify the idea.config.path and idea.system.path keys to define the desired directory (such as the absolute path to the IntellijIdea settings directory in your user home directory). Keep in mind you will need to modify this file anytime you install a new version.

0
Comment actions Permalink

Thanks!

I cannot find these options in the files you specified.

It seems that /Users/John/Library/Preferences/IntelliJIdea14 is being used to store all the settings/license information.

I managed to used a symbolic link

ln -s /Users/John/Library/Preferences/IntelliJIdea14 /private/var/root/Library/Preferences/IntelliJIdea14

To get it partially working but this is less than ideal.

Does anyone know of a way of forcing idea to use /Users/John/Library/Preferences/IntelliJIdea14 when run as sudo on OSX?

Thanks,
John

0

Please sign in to leave a comment.