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:
My .p4config has the following in it (private information changed to XXX for this post):
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:
Perforce client error:
Connect to server failed; check $P4PORT.
TCP connect to perforce failed.
perforce: host unknown.