Skip to content

Commit 46710c0

Browse files
committed
Update and reflow readme
1 parent 50fe765 commit 46710c0

File tree

2 files changed

+49
-24
lines changed

2 files changed

+49
-24
lines changed

README.md

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
3-
Copyright (c) 2002-2020, the original author or authors.
3+
Copyright (c) 2002-2024, the original author or authors.
44
55
This software is distributable under the BSD license. See the terms of the
66
BSD license in the documentation provided with this software.
@@ -32,7 +32,7 @@ JLine is distributed under the [BSD License](https://opensource.org/licenses/BSD
3232

3333
# Artifacts
3434

35-
JLine can be used with a single bundle or smaller fine grained jars. The bundle contains all jars except `jline-groovy` that must be included in classpath if you want to use scripting capabilities.
35+
JLine can be used with a single bundle or smaller fine-grained jars. The bundle contains all jars except `jline-groovy` that must be included in classpath if you want to use scripting capabilities.
3636
The big bundle is named:
3737

3838
jline-${jline.version}.jar
@@ -55,6 +55,13 @@ You can also use fine grained jars:
5555
* `jline-groovy`: `ScriptEngine` implementation using Groovy
5656
* `jline-console-ui`: provides simple UI elements on ANSI terminals
5757

58+
# JANSI
59+
60+
The JANSI project has been merged into JLine.
61+
The following artifacts are available:
62+
* `jansi-core`: the fine-grained jar containing jansi
63+
* `jansi`: a jar bundle which contains `jansi-core` and the needed jline dependencies
64+
5865
## Supported platforms
5966

6067
JLine supports the following platforms:
@@ -66,47 +73,57 @@ JLine supports the following platforms:
6673

6774
## FFM vs JNI vs Jansi vs JNA vs Exec
6875

69-
To perform the required operations, JLine needs to interoperate with the OS layer. This is done through the JLine
70-
`TerminalProvider` interface. The terminal builder will automatically select a provider amongst the ones
71-
that are available.
76+
To perform the required operations, JLine needs to interoperate with the OS layer.
77+
This is done through the JLine `TerminalProvider` interface. The terminal builder
78+
will automatically select a provider amongst the ones that are available.
7279

73-
On the Windows platform, relying on native calls is mandatory, so you need to have a real provider (`jline-terminal-xxx` jar) registered and its dependencies available (usually the Jansi or JNA library). Failing to do so will create a `dumb` terminal with no advanced capabilities.
80+
On the Windows platform, relying on native calls is mandatory, so you need to have
81+
a real provider (`jline-terminal-xxx` jar) registered and its dependencies available
82+
(usually the Jansi or JNA library). Failing to do so will create a `dumb` terminal
83+
with no advanced capabilities.
7484

7585
By default, the following order will be used.
7686

7787
### FFM
7888

79-
The [FFM](https://docs.oracle.com/en/java/javase/21/core/foreign-function-and-memory-api.html#GUID-FBE990DA-C356-46E8-9109-C75567849BA8) provider is available since JLine 3.24 and when running on JDK >= 21. It's very lightweight with no additional dependencies.
80-
With JLine 3.26, the FFM provider requires JDK 22 with the `--enable-native-access=ALL-UNNAMED` JVM option.
81-
Note that JLine 3.24 and 3.25 uses the preview version of FFM support shipped in JDK 21 which is incompatible with the final version in JDK 22.
89+
The [FFM](https://docs.oracle.com/en/java/javase/21/core/foreign-function-and-memory-api.html#GUID-FBE990DA-C356-46E8-9109-C75567849BA8) provider is available since JLine 3.24 and when running on JDK >= 22.
90+
It's very lightweight with no additional dependencies. With JLine 3.26, the FFM
91+
provider requires JDK 22 with the `--enable-native-access=ALL-UNNAMED` JVM option.
92+
Note that JLine 3.24 and 3.25 uses the preview version of FFM support shipped in JDK
93+
21 which is incompatible with the final version in JDK 22.
8294

8395
### JNI
8496

85-
Since JLine 3.24.0, JLine provides its own JNI based provider and native libraries. This is the best default choice, with no additional dependency, but it requires loading a native library.
97+
Since JLine 3.24.0, JLine provides its own JNI based provider and native libraries.
98+
This is the best default choice, with no additional dependency. One requirement is
99+
that JLine will load a native library: this is usually not a problem, but it could
100+
be a limitation in certain environments.
86101

87102
### JANSI
88103

89104
The [Jansi](https://github.com/fusesource/jansi) library is a library specialized in supporting ANSI sequences in
90-
terminals. Historically, the JNI methods used by JLine were provided by Jansi. In order to minimize the maintenance
91-
cost, Jansi will be merged into JLine 3.25.
105+
terminals. Historically, the JNI methods used by JLine were provided by Jansi. In
106+
order to minimize the maintenance cost, Jansi has been merged into JLine 3.25.
92107

93108
This provider has been deprecated in 3.26 in favor of the JNI provider.
94109

95110
### JNA
96111

97-
The [JNA](https://github.com/java-native-access/jna) library aims to provide an alternative way to access native
98-
methods without requiring writing a full JNI native library. If JNA is in JLine's class loader, the provider may
99-
be used. JNA is not supported on Apple M2 architectures.
112+
The [JNA](https://github.com/java-native-access/jna) library aims to provide an alternative way to access native methods
113+
without requiring writing a full JNI native library. If JNA is in JLine's class
114+
loader, the provider may be used. JNA is not supported on Apple M2 architectures.
100115

101116
This provider has been deprecated in 3.26 in favor of the FFM provider.
102117

103118
### Exec
104119

105-
The exec provider is available on Posix systems and on Windows when running under [Cygwin](https://www.cygwin.com)
106-
or [MSys2](https://www.msys2.org). This provider launches child processes whenever the terminal is accessed
107-
(using `Terminal.getAttributes`, `Terminal.setAttributes`, `Terminal.getSize`, `Terminal.setSize`).
120+
The exec provider is available on Posix systems and on Windows when running under
121+
[Cygwin](https://www.cygwin.com) or [MSys2](https://www.msys2.org). This provider launches child processes whenever the
122+
terminal is accessed (using `Terminal.getAttributes`, `Terminal.setAttributes`,
123+
`Terminal.getSize`, `Terminal.setSize`).
108124

109-
This provider also does not support external terminals (for example when creating a terminal for an incoming connection) and does not support the Windows native environment.
125+
This provider also does not support external terminals (for example when creating a
126+
terminal for an incoming connection) and does not support the Windows native environment.
110127

111128
# Maven Usage
112129

@@ -140,13 +157,14 @@ JLine can also be used with more low-level jars:
140157
</dependency>
141158
```
142159

143-
All the jars and releases are available from Maven Central, so you'll find everything at the following location <https://repo1.maven.org/maven2/org/jline/>.
160+
All the jars and releases are available from Maven Central, so you'll find everything at
161+
the following location <https://repo1.maven.org/maven2/org/jline/>.
144162

145163
# Building
146164

147165
## Requirements
148166

149-
* Maven 3.9.6+
167+
* Maven 3.9.7+
150168
* Java 8+ at runtime
151169
* Java 22+ at build time
152170
* Graal 23.1+ (native-image)
@@ -173,6 +191,10 @@ The big bundle includes everything (except `jline-groovy`) and is located at:
173191

174192
jline/target/jline-${jline.version}.jar
175193

194+
The jansi bundle is located at:
195+
196+
jansi/target/jansi-${jline.version}.jar
197+
176198
The fine grained bundles are located at:
177199

178200
terminal/target/jline-terminal-${jline.version}.jar
@@ -185,10 +207,13 @@ The fine grained bundles are located at:
185207
builtins/target/jline-builtins-${jline.version}.jar
186208
console/target/jline-console-${jline.version}.jar
187209
groovy/target/jline-groovy-${jline.version}.jar
210+
jansi-core/target/jansi-core-${jline.version}.jar
188211

189-
Maven has a concept of `SNAPSHOT`. During development, the jline version will always ends with `-SNAPSHOT`, which means that the version is in development and not a release.
212+
Maven has a concept of `SNAPSHOT`. During development, the jline version will always end
213+
with `-SNAPSHOT`, which means that the version is in development and not a release.
190214

191-
Note that all those artifacts are also installed in the local maven repository, so you will usually find them in the following folder: `~/.m2/repository/org/jline/`.
215+
Note that all those artifacts are also installed in the local maven repository, so you
216+
will usually find them in the following folder: `~/.m2/repository/org/jline/`.
192217

193218
## Running the demo
194219

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright (c) 2002-2022, the original author or authors.
4+
Copyright (c) 2002-2024, the original author or authors.
55
66
This software is distributable under the BSD license. See the terms of the
77
BSD license in the documentation provided with this software.

0 commit comments

Comments
 (0)