Trying to install Emacs JDEE with openjdk 6
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-sourceI 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!
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. :)
精彩评论