如何从 IntellijIdea 运行 leiningen?
我安装了 IntelliJ Idea 10.5.2 以及插件 La Clojure 和 Leiningen。之后安装了 Leiningen,如 GitHub 页面中所述(拿了蝙蝠,因为我在 Windows 7 上运行,并进行了自我安装;我还将蝙蝠的路径放入了 PATH 变量中)
现在,运行Leiningen 中的任何内容都会产生此错误:
E:\leiningen\lein.bat deps 打开注册表项时出错 “Software\JavaSoft\Java Runtime Environment”错误:找不到 java.dll 错误:找不到 Java SE 运行时环境。
所以,问题是“这里出了什么问题?”我尝试按照正确方式安装 Leiningen 的所有步骤。仍然不能完全发挥作用。
如果我从 Windows 命令提示符中转到项目所在的位置,则可以运行 lein 命令。它就是这样工作的。但我想从 IntelliJ 的插件中运行。
此外,我注意到的另一个奇怪的事情是,如果我启动 Total Commander,转到我的项目并从那里启动命令提示符,然后尝试运行任何 lein 命令,我会收到相同的错误.
我的猜测是类路径可能有问题,但是什么问题呢?以及如何修复它?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这不是类路径的问题,而是通过 IntelliJ Leiningen 插件启动 Leiningen 时无法找到正确的 Java 版本的问题。
由于能否启动 JDK 取决于启动 Lein 的主机进程,因此在 Win 7 x64 下可能存在“位数”差异。如果您只安装了一个 32 位或 64 位 JDK,某些程序会尝试仅启动其中一个,因为另一个已被“屏蔽”。
这是由 Win 7 通过注册表的 x86 或 x64 部分或默认程序文件目录在内部完成的。如果主机进程是 32 或 64 位,它只能找到相同“位”的程序或 dll。对于程序文件,该文件为 \Program Files\(x64)和 \Program Files (x86)\(x86);对于注册表 \HKEY_LOCAL_MACHINE\SOFTWARE\(x64)和 \HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\(x86)。
最容易找到的方法是同时安装其他(x86 或 x64)版本的 JDK 和 JRE。这将在注册表和程序文件目录的其他部分注册该版本。
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.