【发布时间】:2013-11-29 01:02:02
【问题描述】:
我正在尝试为 OS X 上的 emacs 24 配置 JDEE。
当我创建一个 .java 文件时,环境似乎是自动加载的(请看图片),所以它似乎安装正确。但是,当我尝试使用 M-x jde-complete 自动完成任何事情时
(我还没有将它绑定到任何键上)我收到以下消息:
找不到 JDK 的工具 jar 文件(或等效文件)。键入 M-x describe-function [RET] jde-get-jdk-dir 了解更多信息。
我运行 /usr/libexec/java_home 来找到我的 Java 主页并将其设置在我的 ~/.bash_profile 中:
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home"
然后我将 JDEE 配置为指向 ~/.emacs 中的 JDK:
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(jde-jdk (quote ("1.7.0_17")))
'(jde-jdk-registry (quote (("1.7.0_17" . "/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home")))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
谁能告诉我为什么自动完成不起作用?我相信我设置的 JDEE 的任何部分目前都没有工作,但是,我使用自动完成来测试,因为这是我开始工作的主要优先事项。
更新:如果我使用M-x jde-compile,它会说
JDE 无法识别 JDK 1.7 javac。假设 JDK 1.6 javac?(是或否)
它似乎找到了我的 JDK。如果我输入yes,它会给出同样的错误(Cannot find JDK's tools jar file (or equivalent)。
【问题讨论】: