Reputation: 4169
I installed IntelliJ Idea 10.5.2 with the plugins La Clojure and Leiningen. Installed Leiningen after that, as mentioned in GitHub page (took the bat, cause I'm running on Windows 7, and did a self install; I also put the path to the bat in the PATH variable)
Now, running anything in Leiningen yeilds this error:
E:\leiningen\lein.bat deps Error opening registry key 'Software\JavaSoft\Java Runtime Environment' Error: could not find java.dll Error: could not find Java SE Runtime Environment.
So, the question is "What is wrong here?" I tried following all steps on installing Leiningen the right way. Still does not work fully.
If I go to where my project is from within a Windows command prompt, then I can run lein commands. It works that way. But I want to run from within the plugin in IntelliJ.
Also, another weird thing I noticed is that if I startup a Total Commander, go to my project and start a Command Prompt from there and then try running any lein commands, I get the same error.
My guess is something might be wrong with the classpath, but what? And how to fix it?
Upvotes: 3
Views: 3212
Reputation: 6956
This is not a problem with the classpath, but a problem with starting Leiningen through the IntelliJ Leiningen plugin not being able to find a correct Java version.
Since it depends on the host process that launches Lein if it can start the JDK or not, it could be a difference in 'bitness' under Win 7 x64. If you have only one 32 or 64 bit JDK installed, some programs try start only one, because the other is 'shielded' away.
This is done internally by Win 7 through the x86 or x64 parts of the registry or default program files dirs. If the host process is 32 or 64 bits it can only find programs or dll's from the same 'bitness'. For program files this is either \Program Files\ for x64 and \Program Files (x86)\ for x86, and for the registry \HKEY_LOCAL_MACHINE\SOFTWARE\ for x64 and \HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ for x86.
Easiest to find out is install the other (x86 or x64) version of the JDK and JRE as well. This will register that version in the other part of the registry and program files dir.
Upvotes: 3