You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+48-23Lines changed: 48 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
<!--
2
2
3
-
Copyright (c) 2002-2020, the original author or authors.
3
+
Copyright (c) 2002-2024, the original author or authors.
4
4
5
5
This software is distributable under the BSD license. See the terms of the
6
6
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
32
32
33
33
# Artifacts
34
34
35
-
JLine can be used with a single bundle or smaller finegrained 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.
36
36
The big bundle is named:
37
37
38
38
jline-${jline.version}.jar
@@ -55,6 +55,13 @@ You can also use fine grained jars:
55
55
*`jline-groovy`: `ScriptEngine` implementation using Groovy
56
56
*`jline-console-ui`: provides simple UI elements on ANSI terminals
57
57
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
+
58
65
## Supported platforms
59
66
60
67
JLine supports the following platforms:
@@ -66,47 +73,57 @@ JLine supports the following platforms:
66
73
67
74
## FFM vs JNI vs Jansi vs JNA vs Exec
68
75
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.
72
79
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.
74
84
75
85
By default, the following order will be used.
76
86
77
87
### FFM
78
88
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.
82
94
83
95
### JNI
84
96
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.
86
101
87
102
### JANSI
88
103
89
104
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.
92
107
93
108
This provider has been deprecated in 3.26 in favor of the JNI provider.
94
109
95
110
### JNA
96
111
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.
100
115
101
116
This provider has been deprecated in 3.26 in favor of the FFM provider.
102
117
103
118
### Exec
104
119
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
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`).
108
124
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.
110
127
111
128
# Maven Usage
112
129
@@ -140,13 +157,14 @@ JLine can also be used with more low-level jars:
140
157
</dependency>
141
158
```
142
159
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/>.
144
162
145
163
# Building
146
164
147
165
## Requirements
148
166
149
-
* Maven 3.9.6+
167
+
* Maven 3.9.7+
150
168
* Java 8+ at runtime
151
169
* Java 22+ at build time
152
170
* Graal 23.1+ (native-image)
@@ -173,6 +191,10 @@ The big bundle includes everything (except `jline-groovy`) and is located at:
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.
190
214
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/`.
0 commit comments