4
votes

I am trying to integrate Perforce into IntelliJ. I have successfully done this in the past but on my new machine I am unsuccessful.

I am using p4v client. I have this client connected to my Perforce Server and I am able to check out code, etc. through it.

I have two problems that may shed light on the issue.

  1. There is no Test Connection button on the Preferences -> Version Control -> Perforce page.
  2. In the Preferences -> Version Control -> Perforce page I have set the location to my p4v client in my Applications directory. Path to p4 executable: p4 (I have also tried this as a blank text box as well) Path to pv4 executable: /Applications/p4v.app/Contents/MacOS/pv4

I have simply put "p4" in the p4 client text field. This is how I had my old environment set up. I have also tried leaving the command line p4 client text box blank as well. When I try to connect I get the error:

   Cannot Connect to the Perforce Server

   Cannot run program "p4" (in directory "...")

The reported directory is the location of the Project on my local machine. Not sure why it is trying to look in my IntelliJ project root directory for the p4 client. Additionally, I have specified no path to the p4 command line client and explicitly set the path to my p4v client so I am not sure why IntelliJ is trying to use p4 command line client at all. Additionally, I went ahead and downloaded the p4 command line client and put it in /usr/local/bin and still IntelliJ tried to grab the p4 client from my project's root directory. I verified that /usr/local/bin is on my PATH.

It seems like a bug in IntelliJ unless I am missing something which is a distinct possibility.

1

1 Answers

5
votes

Do you have p4 executable installed on your machine? You must to integrate with IntelliJ.

If you do, drop to terminal and try which p4 to figure out the full path and use that.

If you don't have p4 installed, then you need to install it (preferably somewhere in your default path), and if it is installed and doesn't show up in your which command, you should locate the executable manually and give the full path to IntelliJ.

In my case, I install p4 in /opt/local/bin and have that prepended to my path in the shell and provide IntelliJ with /opt/local/bin/p4 as the path to it.