How to configure IDEA 8.1.3 to read P4CONFIG on Mac OS X?

I've found an old Bug (http://www.jetbrains.net/jira/browse/IDEADEV-7445) and an old discussion (http://www.jetbrains.net/devnet/thread/276632) about this issue, but both were for previous IDEA versions, and neither helped me solve the problem at hand.

On Mac OS X, when IDEA is configured to "Use P4CONFIG or default connection" the Test Connection command fails with "Connection failed: Perforce client error: Connect to server failed; check $P4PORT.  TCP connect to perforce failed.  perforce: host unknown.  Attempting to do anything with perforce in a specific project fails with the same exception.

I've created a ~/.bash_profile that includes the following line:
export P4CONFIG=.p4config

My .p4config has the following in it (private information changed to XXX for this post):
P4PORT=tpperforce01.XXX.XXX.com:1666
P4USER=XXX
P4CLIENT=XXX_mac_pro

I've tried copying the .p4config into ~, /, /Applications/IntelliJ IDEA 8.1.3.app/bin, the .IML/.IPR directory and my perforce depot root (/depot).  IDEA never seemed to find the .p4config in any of those locations.

P4 itself works fine from the command line.

The p4.output isn't providing anything useful either:
info
ErrCode=1
StdOut:------------

StdErr:------------
Perforce client error:
        Connect to server failed; check $P4PORT.
        TCP connect to perforce failed.
        perforce: host unknown.

End----------------

Ideas?

1 comment
Comment actions Permalink

I finally stumbled upon the answer to this over here: http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x

In summary, GUI apps (such as IDEA) don't have access to environment variables defined in ~/.profile or ~/.bash_profile.  They do read properties from ~/.MacOSX/environment.plist, but not if you launch them from Spotlight.  If you launch GUI apps from Spotlight, you have to defined your environment in /etc/launchd.conf using the syntax 'setenv PROPERTY value'.

0

Please sign in to leave a comment.