Home Code Other Software

Table of Contents


Java EditLine provides a Java (JNI) interface to the Editline library, which is available on BSD systems and Mac OS X, and can be installed on most Linux systems. Editline is a replacement for the GNU Readline library, with a more liberal BSD-style license. Linking Editline into your code (and, similarly, using this Java interface to it) will not change the license you have assigned to your software. You can use Editline and Java EditLine in open source software (even GNU-licensed software), as well as commercial software.

Getting Java Editline

Java EditLine relies on the presence of the Editline library, which isn’t automatically present on all operating systems. In addition, Java EditLine uses the Java Native Interface (JNI) to bridge Java to the C-language Editline library; portions of the Java EditLine are written in C.

It is impractical to provide binaries of Java EditLine for every combination of Unix-like operating system and operating system release. So, currently, you must build Java EditLine from source code, as described below.

There are two ways to get the source code. In the commands below, substitute the current release tag for the string “RELEASE”.

The current release is: release-0.3

Download and unpack a tarball or zipball

Using wget and tar:

$ wget -O javaeditline.tar.gz https://api.github.com/repos/bmc/javaeditline/tarball/RELEASE
$ tar xf javaeditline.tar.gz
$ cd bmc-javaeditline-*

Using curl and tar:

$ curl -L -o javaeditline.tar.gz https://api.github.com/repos/bmc/javaeditline/tarball/RELEASE
$ tar xf javaeditline.tar.gz
$ cd bmc-javaeditline-*

If you prefer, you can download a zip file, instead. Just substitute “zipball” for “tarball” in the above commands.

Clone the Git repository

$ git clone git://github.com/bmc/javaeditline.git
$ cd javaeditline
$ git co RELEASE


This package is only known to work on Unix-like operating systems. I have tested it on:

This Java wrapper does not expose all the functionality of the underlying Editline library.

Building Java EditLine


The code uses GNU Make to build. On Linux systems and Mac OS X, GNU Make is the standard version of make(1). On BSD systems, such as FreeBSD, you’ll have to install it separately. (On most BSD systems, GNU Make is available as the gmake port or package.)

The make logic is split into two pieces:


Deploying Java EditLine

Once you have succcessfully built Java EditLine:

That should be all you need to do.

MAC OS X only

On Mac OS X, using LD_LIBRARY_PATH may not suffice. You may need to set DYLD_LIBRARY_PATH, instead. For instance, suppose you copied libjavaeditline.jnilib to $HOME/lib. You may need to add this environment variable, to get Java to see it:


This wrinkle is also noted in the FAQ.

Frequently Asked Questions

Please see the FAQ.

This software is released under a BSD license. See the accompanying license file for complete details.


I gladly accept patches from their original authors. Feel free to email patches to me or to fork the GitHub repository and send me a pull request. Along with any patch you send: