============================================================================
本文的最初版本可于
http://forum.ubuntu.org.cn/viewtopic.php?t=109439看到(三楼)。
http://www.ibm.com/developerworks/cn/java/joy-emacs/在这里可以看到JDEE的部分优点。
http://jdee.sunsite.dk/jdedoc/html/jde-ug/jde-ug.html此为JDEE使用手册(英文)。
============================================================================
本文参照了
http://www.ibm.com/developerworks/cn/java/joy-emacs/以及
http://jdee.sourceforge.net/install.html上的资料。(推荐想安装这个东东的人看一下这两个网站……尽管非本人完全独立实现,但是转载请注明出处……嗯嗯,我是为了给咱们的Ubuntu中文作宣传……)
============================================================================
所需文件:
1、cedet-1.0pre4.tar.gz (可以从
http://sourceforge.net/project/showfiles.php?group_id=17886&release_id=513873取得。)
2、elib-1.0(从
http://jdee.sunsite.dk/elib-1.0.tar.gz取得。)
3、JDEE(从
http://sourceforge.net/project/showfiles.php?group_id=210946取得。)
============================================================================
步骤:
1、下载elib,解压到某文件夹中(比如我就是/home/lavender/Install/Java-Emacs。据说放到Emacs的安装目录下更好,但由于本人没有找到这个目录,所以……)。
2、下载cedet、JDEE,解压到某目录中(建议和elib放到同样位置)。
3、在终端下定位到cedet的目录下,make(通过cedet下的INSTALL可获得更多信息。)。
4、现在你应该有cedet、jde和elib三个文件夹了。打开.emacs,加入如下代码(在这里假定它们三个文件夹都在/home/lavender/Install/Java-Emacs下。):
代码:
;; Set the debug option to enable a backtrace when a
;; problem occurs.
;; 当有问题出现显示错误信息,便于调试
(setq debug-on-error t)
;; Update the Emacs load-path to include the path to
;; the JDE and its require packages. This code assumes
;; that you have installed the packages in the emacs/site
;; subdirectory of your home directory.
;; 加载所需的package
(add-to-list 'load-path "~/Install/Java-Emacs/cedet-1.0pre4/eieio")
(add-to-list 'load-path "~/Install/Java-Emacs/cedet-1.0pre4/semantic")
(add-to-list 'load-path (expand-file-name "~/Install/Java-Emacs/jde-2.3.5.1/lisp"))
(add-to-list 'load-path (expand-file-name "~/Install/Java-Emacs/cedet-1.0pre4/common"))
(load-file (expand-file-name "~/Install/Java-Emacs/cedet-1.0pre4/common/cedet.el"))
(add-to-list 'load-path (expand-file-name "~/Install/Java-Emacs/elib-1.0"))
;; If you want Emacs to defer loading the JDE until you open a
;; Java file, edit the following line
;; 不自动加载jde-mode
(setq defer-loading-jde t)
;; to read:
;;
;; (setq defer-loading-jde t)
;;
;; 编辑.java文件时加载jde
(if defer-loading-jde
(progn
(autoload 'jde-mode "jde" "JDE mode." t)
(setq auto-mode-alist
(append
'(("\\.java\\'" . jde-mode))
auto-mode-alist)))
(require 'jde))
中间独立的一部分的内容是因机器而异的。其实它们分别是:cedet下的eieio、cedet下的semantic、jde下面的lisp、cedet下面的common、common下的cedet.el以及elib的位置。
5、保存。
============================================================================
从此以后就可以在Emacs中舒服地写Java程序了……C-c C-v C-c编译并检查错误,C-c C-v C-r运行程序!当然,费了这么多精力得到的回报远远不止是这一点……请访问
http://www.ibm.com/developerworks/cn/java/joy-emacs/及
http://jdee.sunsite.dk/jdedoc/html/jde-ug/jde-ug.html获得详细信息……

本人是新手,欢迎各位批评指教拍砖头……
如果有补充指错,绝对是热烈欢迎……
============================================================================
效果图: