/
README
88 lines (60 loc) · 3.01 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
This is my "port" of GNU-Readline to Java. Actually, it is a crude wrapper
using the Java Native Interface (JNI).
Starting from version 0.6, alternative libraries are supported. Currently
only Editline is implemented, but adding support for other implementations
should be easy.
From 0.6 on, JavaReadline also has a fallback solution (System.in) for
platforms without Readline or Editline support, making your programs portable
again.
This version implements basic readline functionality like line editing and
filename completion, which should be just enough for normal use. Not all
functionality is available with all implementations.
Various people contributed code (see the file NEWS for details).
Since I changed some of the code, all bugs are my fault and bugreports
should be adressed to me.
The binary distribution contains the API documentation, a JAR with the
Readline class and the shared library libJavaReadline.so.
The source distribution contains all the source (I hope this doesn't surprise
you ;-) and a system of makefiles. You need the JDK to compile it.
LICENSING ISSUES
================
Although JavaReadline is distributed under the LGPL, the underlying
Readline library is GPL code. The consequence is, that any program
linking with JavaReadline+Readline, will fall under the GPL.
There is a Readline replacement called Editline with a more liberal
license. Use that library if you want to distribute your program
under the LGPL instead of the GPL.
You can fetch the Editline stuff at http://packages.debian.org. You
need libedit2 and libedit-dev. Source code is also available, although
I must admit I did not succeed in compiling it on my non-BSD and
non-Debian system :-(
A second Readline replacement is called Getline. This is a very minimal
Readline-clone with a liberal license, and the source-code is provided
in the java-readline distribution. It has the advantage that it
compiles natively on Windows.
COMPILATION
===========
Compilation requires meson and ninja. Assuming you already have it installed,
compilation should be as simple as:
meson build -Denable-readline=true -DJAVA_HOME="$JAVA_HOME"
cd build
ninja all
If you want Editline support, add "-Denable-editline=true". Getline support
is built by default. It can be disabled with "-Denable-getline=false".
INSTALLATION
============
Copy the files libJava*.so to one of your library directories or add
the directory where you put libJava*.so to LD_LIBARY_PATH. Also, add
java_readline.jar to your CLASSPATH. After building the jar and the shared
library, you can run a program with something like:
LD_LIBRARY_PATH=/usr/lib64 java -cp java_readline.jar org.foo.bar.MyClass
assuming that you put libJava*.so into /usr/lib64.
DEBIAN
======
Thanks to Ben Burton, Debian-packages for JavaReadline are available!
SUPPORT
=======
If you think you found a bug or want to contribute some code, please open
an issue or send a pull request.
This software was originally written by Bernhard Bablok, who has retired
from maintaining. It is now maintained by Andrew Clemons.