22 December 2015

How to solve problem with error "CreateProcess error=2, The system cannot find the file specified" in IntelliJ IDEA and Git ?

Solution works for
Windows
IntelliJ IDEA (I tested on v14  and v15 but you may try it on earlier version too)
git (I tested on version 2.x ,but I am sure,it will work with earlier version)

PROBLEM:
You install git,IntelliJ
You tried to open

ERROR:
"CreateProcess error=2, The system cannot find the file specified"

SOLUTION:
There can be 2 possible cause of this problem:
A. You install git in unusual place, so IntelliJ cannot find it.
B. You are behind proxy that blocks git


If you see above error ,it means that IntelliJ doesn't know where git was installed,so you need set it.
However, before you follow below setup:
  • Make sure that git is installed (Download from: https://git-scm.com)
  • Make sure you set path in Windows environment (Go to Control Panel -> All Control Panel Items -> System -> Advance System Settings -> Environment Variables -> Select  System Variables and in the end add ; and path path to cmd folder of git ... for example 
    • ;C:\Program Files (x86)\Git\cmd)
  • If you error appear during creating a project (for example if you create a new project using existing resources using Gradle) ,then you need create new empty project .
  • Are you at work ? Don't forgot set proxy in IntelliJ IDEA (below is instruction where to find proxy)
So... to solve problem you need:
  1. Open project 
  2. Go to Settings (File -> Settings or press Ctrl+alt+s (on Windows and Linux)) 
  3. In setting search for git or go to Version Control and select Git 
  4. set Path to Git in  "Path to Git executable :"
  5. Apply and OK:)

How to setup proxy
  1. Go to Settings (File -> Settings or press Ctrl+alt+s (on Windows and Linux)) 
  2. Search for proxy or go to Appearance & Behavior -> System settings -> HTTP proxy
  3. Set your proxy (ask DevOps or IT support ,if you don't know :)

Problem solved.

In 99% of cases :
"CreateProcess error=2, The system cannot find the file specified"
 it means, that you didn't setup path to executable to some plugin/module or you didn't install software that IntelliJ needed to run or you didn't setup a proxy

If your proxy setup is correct ,then  open IntelliJ 's log file and see error message where you should see which program caused problem (for example git),then check IDEA support website how to install specific module/plugin and it should solve problem.

Have an epic development!