Upgrading IntelliJ IDEA after Sierra Upgrade: does not have write access to /private/var

sudo xattr -dr com.apple.quarantine IntelliJ\ IDEA.app/
sudo chmod -R 777 IntelliJ\ IDEA.app/

these commands work recursively and fix the trouble


This is happening because of some new security feature in Sierra. I found some information about it here http://lapcatsoftware.com/articles/app-translocation.html

The work around I used was to go to the Application directory where the Intellij app was and delete the xattr com.apple.quarantine from the app. This stops the app from opening up in that read only directory.

ex.

xattr -d com.apple.quarantine IntelliJ\ IDEA.app

If you face this issue in MacOS Mojave, then you should execute following command:

sudo chmod -R 775 /Applications/IntelliJ IDEA.app/Contents/