Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Leiningen tries to call java.exe from a wrong/missing JDK

Some time ago, there were two versions of JDK installed on my PC (1.7.0_09 and 1.7.0_51). Then I uninstalled the former one. Now, when I try to run lein run (even with a dummy project) I get the following message:

java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.7.0_09\bin\java.exe" (in directory "<...>"): CreateProcess error=2, The system cannot find the file specified

What can I do to make lein use the right JDK? The JAVA_HOME and JDK_HOME variables are not set.

like image 879
Oleg Kunov Avatar asked Oct 27 '25 04:10

Oleg Kunov


1 Answers

Check the following settings:

  • Does java -version show the right version ?
  • Does a system variable JAVA_HOME,JDK_HOME,JAVA_CMD or LEIN_JAVA_CMD point to the wrong JDK ?
  • Does your leiningen project profile have a :java-cmd setting forcing a specific JVM ?
  • Does your leiningen user profile ~/.lein/profiles.clj have a :java-cmd setting ?
  • When using an IDE with built-in leiningen, is your IDE project JDK the right one ?
  • Were changes made to lein.sh / lein.bat ?
like image 130
NielsK Avatar answered Oct 29 '25 18:10

NielsK