Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:java: Cannot run program CreateProcess error=2, The system cannot find the file specified

Error:java: Cannot run program "C:/Program Files/Java/jdk1.7.0_45/bin/java" (in directory "C:\Users\navya.chamidisetty\.IntelliJIdea2017.3\system\compile-server"): 
CreateProcess error=2, 
The system cannot find the file specified

I have started using IntelliJ 17 recently. When I checkout all my code in a folder and C:\ and loaded in Intellij. Now when I try to build, I am getting the above mentioned error. Could someone please help me how to solve this.

My %JAVA_HOME% = C:\Program Files\Java\jdk1.8.0_151

Value of Path variable in Environment variables = C:\Program Files\Apache Software Foundation\apache-maven-3.0.3\bin;C:\newcorpweb\cxf\bin

Value of Path variable in System variable = C:\Program Files\Java\jdk1.8.0_151\

like image 402
navya chamidisetty Avatar asked Jan 16 '18 21:01

navya chamidisetty


1 Answers

IDEA doesn't necessary use JAVA_HOME variable. The project SDK (JDK in your case) is setup in the project settings: File -> Project Structure, Project SDK and set up the proper path there.

enter image description here

like image 93
streetturtle Avatar answered Oct 06 '22 06:10

streetturtle