自从切换到ubuntu7.10+emacs下后,java环境JDE一直不能正常使用,将就着使用eclipse工作。今天找了一下,发现原因是ubuntu7.10的几个bug,解决方式如下:
1、安装jde
如果直接使用sudo apt-get install jde,一般是会报错的,原因是文件/usr/share/doc-base/jde有一个小错误,注意下面内容中的Section节:
Section: Apps/Programming
Document: jde
Title: JDEE JDE User's Guide
Author: Paul Kinnucan
Abstract: This guide explains how to use the JDE to develop Java applications
and applets. The Java Development Environment (JDE) is an Emacs Lisp
package that interfaces Emacs to third-party Java application development
tools, such as those provided by JavaSoft's Java Development Kit (JDK). The
result is an integrated development environment (IDE) comparable in power to
many commercial Java IDEs.
Format: HTML
Index: /usr/share/doc/jde/html/jde-ug/jde-ug.html
Files: /usr/share/doc/jde/html/jde-ug/*.html
移动一下Section,修改为:
Document: jde
Title: JDEE JDE User's Guide
Author: Paul Kinnucan
Abstract: This guide explains how to use the JDE to develop Java applications
and applets. The Java Development Environment (JDE) is an Emacs Lisp
package that interfaces Emacs to third-party Java application development
tools, such as those provided by JavaSoft's Java Development Kit (JDK). The
result is an integrated development environment (IDE) comparable in power to
many commercial Java IDEs.
Section: Apps/Programming
Format: HTML
Index: /usr/share/doc/jde/html/jde-ug/jde-ug.html
Files: /usr/share/doc/jde/html/jde-ug/*.html
再次安装jde,通过。
建议使用以下命令安装jde:
sudo apt-get install ant checkstyle libtomcat5.5-java jde
2、解决jde不能加载的问题
安装好jde后,打开java文件只能启用cc-mode,并没有启动jde-mode,查看*Message*会发现Error while loading 50jde这样的错误提示。
这是因为/etc/emacs/site-start.d/50jde.el也存在问题,需要添加几行代码(见中文注释部分):
(setq jde-doc-directory "/usr/share/doc/jde")
; Workaround for JDK 1.6
;;加上以下一行
(require 'beanshell)
(require 'jde-compile)
(defclass jde-compile-javac-16 (jde-compile-javac-15)
()
"Class of J2SDK 1.6 javac compilers.")
(defmethod initialize-instance ((this
jde-compile-javac-16) &rest fields)
;; Call parent initializer.
(call-next-method)
;; Set compiler version.
(oset this version "1.6"))
(add-to-list 'jde-compile-javac-compilers
(jde-compile-javac-16 "javac 1.6.x") t)
;;加上以下两行
(autoload 'jde-mode "jde" "Java Development Environment" t)
(add-to-list 'auto-mode-alist '("\\.java$" . jde-mode))
这一修改参考自
http://www.emacswiki.org/cgi-bin/wiki/JavaDevelopmentEnvironment,但emacswiki上的内容有一些笔误,按上面的修改,测试通过。
分享到:
相关推荐
Ubuntu 7.10安装教程,Ubuntu 7.10安装教程
详细介绍Linux ubuntu7.10的硬盘安装,全是图解,帮你一步一步实现自己的Linux梦想!并且会了7.10,那以后版本的安装也不成问题!
嵌入式开发-ubuntu 7.10安装配置教程
虚拟机中 为 ubuntu7.10 安装 VMware-Tools
可以硬盘安装ubuntu7.10的引导文件,压缩包中包括了vmlinuz和initrd.gz,注意只能用来安装alternate,不适用于desktop,经本人试验可以成功安装ubuntu7.10和ubuntustudio7.10,其他衍生版估计也可以
ubuntu 7.10安装及基本设置 博文链接:https://mqzsweet.iteye.com/blog/149848
硬盘安装Ubuntu7.10.chm硬盘安装Ubuntu7.10.chm硬盘安装Ubuntu7.10.chm硬盘安装Ubuntu7.10.chm硬盘安装Ubuntu7.10.chm硬盘安装Ubuntu7.10.chm
Ubuntu 7.10 Linux Unleashed
基于Ubuntu7.10的minigui开发包
Ubuntu 7.10 Linux 揭秘,学习Ubuntu 7.10 Linux的好资料
ubuntu-7.10-jeos-i386最小的精简版系统,针对虚拟机进行优化,只有151M大小,完整一个包下载,不是分卷
Ubuntu7.10 vivim搭建超级cc++编程环境
Welcome to Ubuntu 7.10 Linux Unleashed! This book covers the free Linux distribution named Ubuntu and includes a fully functional and complete operating system produced by the Ubuntu Community, ...
共计3卷,全下载后,一起...Ubuntu.最小精简版].ubuntu-7.10-jeos-i386[ED2000.COM].part1 Ubuntu.最小精简版].ubuntu-7.10-jeos-i386[ED2000.COM].part2 Ubuntu.最小精简版].ubuntu-7.10-jeos-i386[ED2000.COM].part3
相关BIND9资料 博文链接:https://mqzsweet.iteye.com/blog/149843
本教程教你如何通过vmware将ubuntu装在物理硬盘上,进而通过修改引导开机启动