JEmacs - the Java/Scheme-based Emacs Text Editor
Hosted by
SourceForge.net Logo

JEmacs is a re-implementation of Emacs, written in a mix of Java, Scheme, and Emacs Lisp (ELisp).

JEmacs uses Kawa to compile Scheme and ELisp into Java bytecodes. Kawa is a widely-praised Scheme implementation that includes many Scheme extensions, powerful Java/Scheme interoperability, and high performance though a sophisticated compiler.

Kawa is being extended to support ELisp. This is so JEmacs can run the many existing Emacs packages written in ELisp. These will be compiled into Java bytecodes, which means ELisp will run on any Java engine, and benefit from the engineering being put into JVMs, such as "Just-In-Time" compilers. This could be substantially faster than the existing Emacs bytecode interpreter.

It will also be possible to write Emacs packages using Scheme. This should provide higher performance and cleaner design through the use of static scoping. You also get all the extensions and optimizations of Kawa. (The FSF also plans to base a future Emacs on Scheme, using Guile; however, I believe Kawa will provide better performance and a better design.)

JEmacs uses either the Swing toolkit or Eclipse's SWT toolkit to provide GUI functionality. Swing is the latest standard Java GUI toolkit, provides lots of high-level functionality, and has many concepts inspired by Emacs. (Swing is freely available, but not free software.)

JEmacs - The Java/Scheme-based Emacs appeared in the March 2002 issue of the Free Software Magazine. It is a revision of a paper presented at Usenix 2000.

Status and Screenshots

Currently, JEmacs is a functional but very minimal editor. For example, searching commands are not implemented. And JEmacs is not robust or reliable. Many of the core Emacs concepts (keymaps, windows, frames, buffers, markers) are implemented, and generally in such a way as to provide the standard Emacs semantics. Enough of ELisp is implemented to compile non-trivial ELisp file, though many of the necessary functions and macros are missing.

Update (2005-10-19)! Kawa version 1.8, including JEmacs updates, was released today. The biggest new feature is that you can now choose between using the Swing toolkit, or the new SWT toolkit support, contributed by Christian Surlykke. Otherwise JEmacs has been fairly quiet for a while, with only minimal maintainance. Now that JEmacs is no longer tied to Swing, it would be nice to see some or all of: a Jemacs package that uses the Gnome2 text widgets (with Pango); one that uses the SWT toolkit that is part of the Eclipse project; one that uses plain AWT; and one that works on plain terminals.

This status file has some more details, though it has not been updated in a while.

This screenshot shows multiple windows, one of which a Scheme interaction window.

Here we see the menu bar support contributed by Simon Josefsson.

This screenshot of Lisp Interaction mode shows how interactive commands are defines in ELisp.

The Emacs Lisp version of Towers of Hanoi now runs without modification under JEmacs.

There is now a passable telnet mode.

Where to get it

The JEmacs sources are distributed as part of Kawa, which you can get from the Kawa ftp site or a mirror site.

The easiest way to try out JEmacs is to grab the most recent compiled kawa-version.jar file, currently kawa-1.8.jar.

You can get a recent source release, for example kawa-1.8.tar.gz.

You can also check out the very latest version via anonymous CVS (not currently on SourceForge). (Use the password anoncvs.)

cvs -d :pserver:anoncvs@sources.redhat.com:/cvs/kawa login
cvs -d :pserver:anoncvs@sources.redhat.com:/cvs/kawa co kawa
Once you have it checked out, you can update it with cvs update.

You can also view the cvs archive via cvsweb

Running JEmacs

JEmacs by default uses Swing, and works best with a JDK 1.4-compliant Java implementation.

To start JEmacs, just start running Kawa. For example, if you downloaded kawa-version.jar just do:

java -classpath kawa-version.jar gnu.jemacs.lang.ELisp

The most common Emacs key-bindings work. You can type M-x, which brings up a dialog asking for the name of a function to call. (There is no miinbuffer yet.)

You can also type ELisp expressions at the prompt. For example, to bring up a Lisp interaction window, do:

#|kawa:1|# (lisp-interaction)
Author and contact information
JEmacs is written by Per Bothner <per@bothner.com>.

There is jemacs-info mailing list; with an information page.

Per Bothner
Last modified: Tue Oct 18 23:23:45 PDT 2005