-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJSHELL
36 lines (21 loc) · 1.19 KB
/
JSHELL
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
When you're loading external libraries, having to type out the full classpath can be burdensome.
You can instead change to the current directory of where all your external libraries are located
and start jshell from that directory, utilizing an asterisk (surrounded by quotes) to include all
jars. This works on all OSes.
$ jshell --class-path "*"
The same command also works with paths. This also works on all OSes.
$ jshell --class-path "libs/*"
if you've already typed a number of commands but forgot to set the classpath when you started
JShell, you can also utilize the /env command to set the classpath.
jshell> /env --class-path foo.jar
CTRL-A - Move the cursor to the start of the current line
CTRL-E - Move the cursor to the end of the current line
ALT-F - Move forward a word
ALT-B - Move backwards a word
JShell utilizes JLine2 to power the command-line. It's a Java equivalent of GNU ReadLine that allows
you to edit or navigate commands typed on your command-line. All modern shells such as Bash use it
(it's also why you can't type CTRL-V to paste into a shell)
Sample JSHELL PROJECT
https://github.com/janardhannallapati/jshell
source :
https://www.infoq.com/articles/jshell-java-repl/