查看文章
 
用Emacs-Jde-Ant来开发Java配置说明
2006年10月09日 星期一 下午 3:18
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Install load hooks into your .emacs file.
;; (load-file "~/../init/jde-init.el")
;;
;
;; 打开 debug ,方便输出错误信息
;; (setq debug-on-error t) 

;; Load Cedet Elib Jde
(add-to-list 'load-path (expand-file-name "~/../site-lisp/cedet/common"))
(load-file (expand-file-name "~/../site-lisp/cedet/common/cedet.elc"))
(add-to-list 'load-path (expand-file-name "~/../site-lisp/jdee/lisp"))
(add-to-list 'load-path (expand-file-name "~/../site-lisp/elib"))

;; 在这里定义你得CLASSPATH 需要的话,就修改这个文件,然后 M-x load-file
(setq jde-compile-option-classpath (quote ("./" 
;;                                         "../" "../../" "../../../"
                                           "d:/mysoft/java/jdk/lib/dt.jar"
                                           "d:/mysoft/java/jdk/lib/tools.jar"
;;                                         "~/../bin/apache-ant/lib/ant.jar"
;;                                         "D:/mysoft/webserver/resin_3_0_21/lib/jsdk-24.jar"
;;                                         "D:/website/cqtel.softreg.com/WEB-INF/lib/webpro2.jar"
;;                                         "D:/website/cqtel.softreg.com/WEB-INF/lib/xfire-all-1.2.2.jar"
                                           )))

(setq jde-debugger (quote ("JDEbug")))

;; 用JDK1.5编译如果出现乱码,加上下面一行可以解决
(setq jde-compiler (quote ("javac" "")))

(setq jde-complete-function (quote jde-complete-menu))

;; JDK版本号和JAVA_HOME
(setq jde-jdk-registry (quote (("1.5" . "D:/mysoft/java/jdk"))))

;; 定义 ANT_HOME
(setq jde-ant-home "D:/emacs22/custom/bin/apache-ant")

;; 将 %ANT_HOME%/bin 放在你的环境变量PATH中
(setq jde-ant-program "ant")
;;(setq jde-ant-program "D:/emacs22/custom/bin/apache-ant/bin/ant")

;; 默认的是 Script 在 window下不是找不到文件,就是说ant不可执行 
;; 设置为Ant Server就好了
(setq jde-ant-invocation-method (quote ("Ant Server")))

;; 可能我理解错了,我以为会在用ant发布的时候在 -classpath 里多加上下面jar包 
(setq jde-ant-user-jar-files (quote ("~/../bin/apache-ant/lib/ant.jar")))

;; 如果不用msf-abbrev的话,可以在去掉下面这段注释
;; 就可以在第一次打开.java文件的时候再载入jde
; (setq defer-loading-jde t)
; (setq jde-enable-abbrev-mode t)
; (if defer-loading-jde
; (progn 
; (autoload 'jde-mode "jde" "JDE mode." t) 
; (setq auto-mode-alist 
; (append '(("\\.java\\'" . jde-mode)) 
; auto-mode-alist))) 

;; 开启Emacs时就载入Jde,这样msf-abbrev就不会出错
(require 'jde)

;; 反编译 C-x C-f 打开一个Jar包,在Class文件上按 j 就会给出反编译的代码
;; 需要 jad.exe 和 unzip.exe 配合
(load-file "~/../lisp/decomp.el") 

;; Jmake我用不好,谁来教教我
(require 'jmaker)
(require 'jjar)
(require 'jsee)
(setq jmaker-end-of-line-format (quote dos))
(setq jmaker-java-compiler-options "")

;; load ecb
(add-to-list 'load-path (expand-file-name "~/../site-lisp/ecb"))
(require 'ecb)
;; 防止CPU占用 100%
(setq semantic-idle-scheduler-idle-time 432000)
;;
;; 启动Ecb如果有警告
;; Warning: `semantic-before-toplevel-bovination-hook' is an obsolete variable;
;;    use `semantic--before-fetch-tags-hook' instead.
;; 可以修改ecb-util.el
;; 注释掉这两行 (428行)
;; (semantic-before-toplevel-bovination-hook (lambda ()
;;                                           nil))
;; 从新编译 M-x byte-compile-file <RET> <RET>

;;; end of jde-init.el
效果图
 



cedet: ------- http://cedet.sourceforge.net
jde: ---------- http://jdee.sunsite.dk
elib: --------- http://jdee.sunsite.dk/elib-1.0.zip
jikes.exe --- http://www.smth.org/att.php?p.573.45164.2424.exe
jad.exe ----- http://www.smth.org/att.php?p.573.45164.2885518.exe
unzip.exe -- http://www.mame.net/zips/compile/unzip.exe
jjar.el ------- http://www.smth.org/att.php?s.573.45164.3381154.el
jsee.el ------ http://www.smth.org/att.php?s.573.45164.3393635.el
jmaker.el --- http://www.smth.org/att.php?s.573.45164.3406420.el
ecb-util.el -- http://www.smth.org/att.php?p.573.45164.3424967.el

类别:Emacs||添加到搜藏 |分享到i贴吧|浏览(4056)|评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
     

   
帮助中心 | 空间客服 | 投诉中心 | 空间协议
©2012 Baidu