Emacs Java メモ
Javaを勉強することになったのでEmacsにJava環境を構築した。
JavaはIDEで開発するのが普通みたいだけど、今はそこまでするほどのプログラムを書くわけではないのでEmacsですることにした。
Emacs ver23.3
Homebrewでいれたもの
brew install emacs --cocoa brew install maven
今回入れるもの
anything.el
malabar-mode
yasnippet
anything.elとyasnippetは結構すんなり入ったけど、malabar-modeでハマった。
anything.elはauto-installから入れたら簡単だった。
auto-install はここから http://www.emacswiki.org/emacs/download/auto-install.el
(require 'auto-install) (setq auto-install-directory "~/.emacs.d/auto-install/") (auto-install-update-emacswiki-package-name t) (auto-install-compatibility-setup)
M-x auto-install-batch anything
を実行して C-c C-c をひたすら押していく終わったら下記を記述してanything.elは終了
(require 'anything-startup)
yasnippet java-mode
https://github.com/chuwb/yasnippet-java-topcoder
上記からファイルをダウンロードしてyasnippetのロードパスに置いたら終了
malabarは結局何をすれば入ったのかわからな行ったので作業した事をすべてメモしておく
git clone git://github.com/espenhw/malabar-mode.git cd malabar-mode git checkout malabar-1.4.0
cedetがうまく読み込まれなかったのでcedetをダウンロードしてパスを
malabar-mode/src/test/lisp/load-all.el に記述する
(load-file "~/.emacs.d/cedet-1.0/common/cedet.el")
pom.xmlも編集
mvn -Dmaven.test.skip=true package
malabar-1.4.0-dist.zipが出来るので解凍する
最後に.emacsに以下を記述して終了
(load-file "~/.emacs.d/cedet-1.0/common/cedet.el") (require 'cedet) (semantic-load-enable-minimum-features) ;; or enable more if you wish (add-to-list 'load-path "~/.emacs.d/malabar-1.4.0/lisp/") (require 'malabar-mode) (setq malabar-groovy-lib-dir "~/.emacs.d/malabar-1.4.0/lib") (add-to-list 'auto-mode-alist '("\\.java\\'" . malabar-mode))
途中メモってなくて適当なところもあるけどだいたいこんな感じで入れた。
後は必要に応じたものを追加で入れていくかな
参考サイト
http://d.hatena.ne.jp/nekop/20101215/1292380225
http://w.livedoor.jp/mojavy/d/malabar-mode%20%A5%D3%A5%EB%A5%C9
http://d.hatena.ne.jp/smotokezuru/20100418/1271565315