FedoraForum.org - Fedora Support Forums and Community
Results 1 to 14 of 14
  1. #1
    Join Date
    Dec 2009
    Posts
    51

    emacs java

    I got few Question i use emacs24 and i want to install Jdee for java.And i like to know what would be the easy path to setup in my emacs file.What lib do i need to make sure jdee work on emacs 24?

  2. #2
    Join Date
    Nov 2006
    Location
    Detroit
    Posts
    6,682

    Re: emacs java

    If you figure out how to get JDEE working with Emacs 24, then you will be my personal hero.

    I've tried everything possible to get it working, and it always bombs out with a message saying "Error: Forgot to expand macro eieio-object-p" in the *Compile-Log* buffer and "Invalid function: eieio-object-p" in the *Warnings* buffer. CEDET seems to be the problem (or at least how JDEE uses CEDET). I've even tried the latest CEDET bzr snapshots and that didn't help (it caused errors of another kind).

    My solution was to download the source for Emacs 23.4.1 and compile that, since at least that works with JDEE. Unfortunately it looks like there hasn't been much activity on JDEE lately, so I have no idea if it will be fixed for Emacs 24 any time soon. It's a shame, because JDEE makes Emacs pretty decent for Java development (magnitudes better than the normal built-in Java mode).
    OS: Fedora 27 x86_64 | Machine: HP Pavilion a6130n | CPU: AMD 64 X2 Dual-Core 5000+ 2.6GHz | RAM: 7GB PC5300 DDR2 | Disk: 400GB SATA | Video: ATI Radeon HD 4350 512MB | Sound: Realtek ALC888S | Ethernet: Realtek RTL8201N

  3. #3
    Join Date
    Dec 2009
    Posts
    51

    Re: emacs java

    Do you know any good tools that are good for java and emacs other then jdee?

  4. #4
    Join Date
    Nov 2006
    Location
    Detroit
    Posts
    6,682

    Re: emacs java

    The only other one I know of is malabar-mode. I've never been able to get it to compile completely, but maybe you'll have more luck.

    ---------- Post added at 08:43 PM ---------- Previous post was at 05:56 PM ----------

    Woohoo!!!

    I finally got JDEE working in Emacs 24!

    For anyone interested, here's what I did:

    1. Download CEDET 1.1 from here and unpack the zip file in the /usr/share/emacs/site-lisp directory.
    2. Download JDEE 2.4.0.1 from here and unpack the zip file in the /usr/share/emacs/site-lisp directory.
    3. Edit the file /usr/share/emacs/site-lisp/jdee-2.4.0.1/lisp/jde.el, changing line 43 from this:
      Code:
      (defconst jde-cedet-max-version "1.0"
      to this:
      Code:
      (defconst jde-cedet-max-version "1.1"
      The reason is that Emacs 24 won't work with CEDET 1.0.
    4. Delete the /usr/share/emacs/site-lisp/jdee-2.4.0.1/lisp/jde.elc file. The reason is that the old CEDET max version is hardcoded to be 1.0 in the compiled jde.elc file, but version 1.1 is needed by Emacs 24. Deleting this file forces Emacs to use the uncompiled jde.el file edited in Step 3.
    5. Put this in your ~/.emacs file:
      Code:
      (add-to-list 'load-path "/usr/share/emacs/site-lisp/cedet-1.1/common")
      (load-file "/usr/share/emacs/site-lisp/cedet-1.1/common/cedet.el")
      (add-to-list 'load-path "/usr/share/emacs/site-lisp/jdee-2.4.0.1/lisp")
      (require 'jde)
      (defun screen-width nil -1)
      (define-obsolete-function-alias 'make-local-hook 'ignore "21.1")
      The second-to-last line is to avoid an error ("Symbol's function definition is void: screen-width") when trying to use "Run App" in the JDE menu, and the last line is to avoid an error with a function (make-local-hook) that JDEE uses but has been obsolete since Emacs 21.
    OS: Fedora 27 x86_64 | Machine: HP Pavilion a6130n | CPU: AMD 64 X2 Dual-Core 5000+ 2.6GHz | RAM: 7GB PC5300 DDR2 | Disk: 400GB SATA | Video: ATI Radeon HD 4350 512MB | Sound: Realtek ALC888S | Ethernet: Realtek RTL8201N

  5. #5
    Join Date
    Dec 2009
    Posts
    51

    Re: emacs java

    Same in emacs 23.4?

  6. #6
    Join Date
    Nov 2006
    Location
    Detroit
    Posts
    6,682

    Re: emacs java

    For Emacs 23.4 use CEDET 1.0 instead of 1.1. So you won't have to do steps 3 and 4.
    OS: Fedora 27 x86_64 | Machine: HP Pavilion a6130n | CPU: AMD 64 X2 Dual-Core 5000+ 2.6GHz | RAM: 7GB PC5300 DDR2 | Disk: 400GB SATA | Video: ATI Radeon HD 4350 512MB | Sound: Realtek ALC888S | Ethernet: Realtek RTL8201N

  7. #7
    Join Date
    Dec 2009
    Posts
    51

    Re: emacs java

    I do that with emacs 23.4 and i get this error.

    File error: Cannot open load file, /usr/share/emacs/site-lisp/cedet-1.1/common/cedet.el

  8. #8
    Join Date
    Nov 2006
    Location
    Detroit
    Posts
    6,682

    Re: emacs java

    You're using the path to the CEDET 1.1 files. If you install CEDET 1.0 then the file would be /usr/share/emacs/site-lisp/cedet-1.0/common/cedet.el.
    OS: Fedora 27 x86_64 | Machine: HP Pavilion a6130n | CPU: AMD 64 X2 Dual-Core 5000+ 2.6GHz | RAM: 7GB PC5300 DDR2 | Disk: 400GB SATA | Video: ATI Radeon HD 4350 512MB | Sound: Realtek ALC888S | Ethernet: Realtek RTL8201N

  9. #9
    Join Date
    Dec 2009
    Posts
    51

    Re: emacs java

    i useing the same ~/.emacs you put down.So i not sure why i got the error.

  10. #10
    Join Date
    Dec 2009
    Posts
    51

    Re: emacs java

    Any know what going on here?

  11. #11
    Join Date
    Nov 2006
    Location
    Detroit
    Posts
    6,682

    Re: emacs java

    As I mentioned in post #6, for Emacs 23.4 you need CEDET 1.0, not 1.1. So install CEDET 1.0 under /usr/share/emacs/site-lisp and then change the corresponding 2 lines in your ~/.emacs accordingly:
    Code:
    (add-to-list 'load-path "/usr/share/emacs/site-lisp/cedet-1.0/common")
    (load-file "/usr/share/emacs/site-lisp/cedet-1.0/common/cedet.el")
    OS: Fedora 27 x86_64 | Machine: HP Pavilion a6130n | CPU: AMD 64 X2 Dual-Core 5000+ 2.6GHz | RAM: 7GB PC5300 DDR2 | Disk: 400GB SATA | Video: ATI Radeon HD 4350 512MB | Sound: Realtek ALC888S | Ethernet: Realtek RTL8201N

  12. #12
    Join Date
    Jun 2012
    Location
    China
    Posts
    1

    Re: emacs java

    Thanks, Rupert.
    In your solution, Emacs 24.1 built-in ceded is not used, right?

  13. #13
    Join Date
    Nov 2006
    Location
    Detroit
    Posts
    6,682

    Re: emacs java

    Quote Originally Posted by stopro
    In your solution, Emacs 24.1 built-in ceded is not used, right?
    Correct. I'm not sure if the built-in CEDET has ever worked with JDEE.

  14. #14
    Join Date
    Dec 2009
    Posts
    51

    Re: emacs java

    thanks i got it to work in emacs 24.2

    it take abit but it works

Similar Threads

  1. emacs vs emacs client
    By foampile in forum Using Fedora
    Replies: 2
    Last Post: 11th April 2012, 02:42 AM
  2. Latest Emacs v Fedora Emacs
    By olwe in forum Using Fedora
    Replies: 7
    Last Post: 3rd May 2011, 06:59 PM
  3. How to set emacs color-theme from .emacs file?
    By mohan.10 in forum Programming & Packaging
    Replies: 3
    Last Post: 9th November 2010, 10:58 PM
  4. Emacs/Vim code completion java C++
    By ihavenoname in forum Programming & Packaging
    Replies: 4
    Last Post: 10th April 2008, 12:17 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •