尝试使用 openjdk 6 安装 Emacs JDEE
我正在尝试让 JDE 自动完成 Java 代码。我正在运行 Ubuntu,并且安装了以下软件包:
openjdk-6-doc
openjdk-6-jdk
openjdk-6-jre
openjdk-6-jre-无头
openjdk-6-jre-lib
openjdk-6-source
我“从源代码”(不是从包管理器)安装了 JDEE。 我在 .emacs 中包含了以下内容,正如此处另一个线程中所建议的那样(我检查了目录确实存在,并且似乎已经使用上面的包安装了正确的内容):
;;JDEE
(add-to-list 'load-path "/usr/share/emacs/site-lisp/jdee-2.4.0.1/lisp")
(setq
jde-bug-debugger-host-address "127.0.0.1"
jde-bug-jre-home "/usr/lib/jvm/java-6-openjdk"
jde-compile-option-debug (quote ("all" (t nil nil)))
jde-debugger (quote ("jdb"))
jde-global-classpath
(quote ("." "/usr/share/java/" "/usr/lib/jvm/java-6-openjdk/"))
jde-jdk-doc-url "/usr/share/doc/openjdk-6-doc/html/api/index.html"
jde-jdk-registry (quote (("1.6.0" . "/usr/lib/jvm/java-6-openjdk")))
jde-jdk (quote ("1.6.0"))
jde-regexp-jar-file "/usr/share/java/regexp.jar"
jde-sourcepath (quote (".")))
(require 'jde)
编辑 .java 文件时,Mx jde-compile 等功能可以工作很好,本地类出现在速度栏中,本地类有自动补全功能,但 : 例如,如果我输入以下内容:
import java.io.*;
import java.lang.*;
public class foo {
private String bar;
public static void main(String args[]) {
System.o
}
}
并且光标位于“System.o”,则不建议补全,即使我尝试 Mx语义-ia -完整符号菜单。 (消息显示“无法找到“系统”的类型”)。
如果我输入“你好”。菜单给了我两个建议: main 或 bar
我注意到所有 java (io, lang...) 类文件都压缩在 /usr/lib/jvm/java-6-openjdk/src.zip 中并尝试解压缩它,在 emacs 中没有结果。
我缺少什么?
谢谢你!
I am trying to get JDE to auto-complete Java code. I'm running Ubuntu and I have the following packages installed:
openjdk-6-doc
openjdk-6-jdk
openjdk-6-jre
openjdk-6-jre-headless
openjdk-6-jre-lib
openjdk-6-source
I installed JDEE "from source" (not from the package manager).
I included the following in my .emacs, as suggested in another thread here (I checked the directories do exist and seem to have the right content installed with the packages above):
;;JDEE
(add-to-list 'load-path "/usr/share/emacs/site-lisp/jdee-2.4.0.1/lisp")
(setq
jde-bug-debugger-host-address "127.0.0.1"
jde-bug-jre-home "/usr/lib/jvm/java-6-openjdk"
jde-compile-option-debug (quote ("all" (t nil nil)))
jde-debugger (quote ("jdb"))
jde-global-classpath
(quote ("." "/usr/share/java/" "/usr/lib/jvm/java-6-openjdk/"))
jde-jdk-doc-url "/usr/share/doc/openjdk-6-doc/html/api/index.html"
jde-jdk-registry (quote (("1.6.0" . "/usr/lib/jvm/java-6-openjdk")))
jde-jdk (quote ("1.6.0"))
jde-regexp-jar-file "/usr/share/java/regexp.jar"
jde-sourcepath (quote (".")))
(require 'jde)
When editing a .java file, functions like M-x jde-compile work fine, local classes appear in speedbar, there is autocompletion for local classes BUT not for : for example if I type the following:
import java.io.*;
import java.lang.*;
public class foo {
private String bar;
public static void main(String args[]) {
System.o
}
}
And the cursor is at 'System.o', no completion is suggested, even when I try M-x semantic-ia-complete-symbol-menu. (The message says "Cannot find types for "System"").
If I type 'hello.' the menu gives me two sugestions: main or bar
I noticed that all the java (io, lang...) class files are compressed in /usr/lib/jvm/java-6-openjdk/src.zip and tried to uncompress it, with no results in emacs.
What am I missing?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您查看 用户指南中的“完成表达式”部分您可以找到 jde-complete 函数。默认情况下,此函数绑定到“Cc Cv C-”。 。也许你错过了。 :)
If you look at the User's guide in the "Completing Expressions" section you can find the jde-complete function. By default this function is bound to "C-c C-v C-." . Maybe you missed it. :)