--- Begin Message ---
Subject: |
Re: JDEE help (was: Emacs and Java) |
Date: |
Sat, 15 Sep 2012 08:22:24 +0100 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/23.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
In the end I've bitten the bullet, pulled a fresh svn copy of JDEE, built it and
somehow managed to get it working.
This is my config, mostly taken from the emacswiki article
<http://emacswiki.org/emacs/JavaDevelopmentEnvironment>:
---------------8<---------------
(add-to-list 'load-path (expand-file-name "~/.emacs.d/site-lisp/jdee/lisp"))
(setq semantic-default-submodes '(global-semantic-idle-scheduler-mode
global-semanticdb-minor-mode
global-semantic-idle-summary-mode
global-semantic-stickyfunc-mode
global-semantic-mru-bookmark-mode))
(setq semantic-load-turn-everything-on t)
(semantic-mode 1)
(require 'semantic)
(require 'semantic/senator)
(require 'semantic/ia)
(require 'semantic/wisent)
(require 'semantic/wisent/java-tags)
(setq jde-auto-parse-enable nil)
(setq jde-enable-senator nil)
(load "jde-autoload")
(require 'jde)
(setq jde-ant-enable-find t
jde-build-function 'jde-ant-build
jde-ant-args "compile")
(add-to-list 'auto-mode-alist '("\\.java\\'" . jde-mode))
(push 'jde-mode ac-modes)
(setq jde-jdk '("1.7")
jde-jdk-registry '(("1.6" . "/usr/lib/jvm/java-1.6.0-openjdk-amd64")
("1.7" . "/usr/lib/jvm/java-1.6.0-openjdk-amd64")))
(define-key jde-mode-map (kbd "<f5>") 'jde-build)
(define-key jde-mode-map (kbd "<f6>") 'jde-run)
(defun java-hooks ()
(menu-bar-mode 1)
(wisent-java-default-setup)
(setq c-basic-offset 4)
(setq fill-column 90)
(setq whitespace-line-column 90)
(jde-abbrev-mode))
(add-hook 'jde-mode-hook 'java-hooks)
(add-hook 'java-mode-hook 'java-hooks)
--------------->8---------------
Then for each project I have I create a `prj.el' file something like
(jde-project-file-version "1.0")
(jde-set-variables)
(setq jde-global-classpath '("/path/where/project/classes/are"))
(setq bsh-classpath '("/path/where/project/classes/are"))
This is already a huge improvement, the semantic mode works, and I can compile
and run java classes easily.
However, I still need some help to make some feature work:
* proper completion: right now, if I press `C-c C-v .' the completion works,
but only for classes outside my project. I'm afraid that jde is not picking
up the project classpath for some reason, or something else is going wrong.
Is there a way to force a reload of the classes?
* completion with auto-complete: is it possible to bind in some way the jdee
completions with auto-complete? I could define the ac sources manually but
maybe there is something already...
* beanshell: similar to the problem above, beanshell works (miracle!) but my
project classpath is not included. As you can see I set `bsh-classpath' but
it does not seem to have an effect.
* syntax highlighting: while semantic seems to parse java correctly (I think
that `wisent-java-default-setup' should provide an improved parser),
generics & co. are still not highlighted. Is there a way to make that work?
* tags and semantics: this is more of a semantics question, but I'd like to
jump to semantics tags when I press `M-.' instead of having to type the
horrible `C-c , J' and then specify the name manually.
* flymake: this is not essential, but is it possible to tie the jde
compilation (`jde-build') to flymake?
When I'm done with this I'll write a wiki page documenting the steps to take, I
think that with enough configuration JDEE could be the solution.
Thanks,
Francesco.
--
Francesco * Often in error, never in doubt
--- End Message ---