11JShell Plugin
22=============
33
4- > :warning : the plugin is not working properly with Java 12+, check this
5- > [ section] ( #the-console-is-exited-once-started ) , although it works with
6- > Java 9 to 11 (version 11 is LTS, use it! :point_left : ), check also how to deal with
7- > different versions of Java [ here] ( #i-have-a-jdk-9-installation-but-my-default-jdk-is-the-jdk-8-or-below ) .
8-
9- This ** Gradle plugin** helps you to explore your code and dependencies in your gradle project
4+ ** Gradle plugin** that helps you to explore your code and dependencies in your gradle project
105with in [ jshell] ( https://docs.oracle.com/javase/9/jshell/introduction-jshell.htm ) ,
11- the official Java REPL tool.
6+ the official Java REPL tool (Java 9+) .
127
138Hosted in the ** Gradle plugins** site: https://plugins.gradle.org/plugin/com.github.mrsarm.jshell.plugin
149
@@ -28,28 +23,11 @@ To use this plugin, add the following to your `build.gradle`:
2823
2924``` groovy
3025plugins {
31- id "com.github.mrsarm.jshell.plugin" version "1.0.0"
32- }
33- ```
34-
35- or in Gradle < 2.1:
36-
37- ``` groovy
38- buildscript {
39- repositories {
40- maven {
41- url "https://plugins.gradle.org/m2/"
42- }
43- }
44- dependencies {
45- classpath "gradle.plugin.com.github.mrsarm:jshell-plugin:1.0.0"
46- }
26+ id "com.github.mrsarm.jshell.plugin" version "1.1.0"
4727}
48-
49- apply plugin: "com.github.mrsarm.jshell.plugin"
5028```
5129
52- Task ` jshell ` is now enabled, which execute jshell with your classes and
30+ Task ` jshell ` is now enabled, which execute the jshell with your classes and
5331dependencies after compiling your code.
5432
5533You need to run the task ` jshell ` with the option ` --console plain ` .
@@ -103,7 +81,7 @@ at the beginning of the session.
10381You can override the startup script path with the project
10482property ` jshell.startup ` in the ` gradle.properties ` file,
10583or set the same property directly in the command line
106- arguments:
84+ arguments:
10785
10886 $ gradle --console plain jshell -Pjshell.startup=/path/to/run.jsh
10987
@@ -280,7 +258,7 @@ the JDK installation, eg:
280258
281259The export will live just whiting the session where is defined,
282260it does not change your system configuration globally, and calling
283- to ` unset JAVA_HOME ` or opening a new session the export will
261+ ` unset JAVA_HOME ` or opening a new session the export will
284262not have effect anymore.
285263
286264You can even create an alias in your ` ~/.profile ` / ` ~/.bashrc `
@@ -311,6 +289,15 @@ weird characters in the console. Unfortunately, with the
311289current console support from Gradle, there is no
312290solution for this [ bug] ( https://github.com/mrsarm/jshell-plugin/issues/2 ) .
313291
292+ However, the JShell task can be invoked with the command ** rlwrap** from the
293+ console to overcome the issue:
294+
295+ $ rlwrap ./gradlew --console plain jshell
296+
297+ ` rlwrap ` takes care of the autocompletion, and the arrow keys management.
298+ Just remember to check you have installed it before invoking the JShell with
299+ the command the first time.
300+
314301
315302System Requirements
316303-------------------
@@ -322,6 +309,9 @@ System Requirements
322309Build and Publish
323310-----------------
324311
312+ > :information_source : Only for developers that want to make
313+ > changes to this source code.
314+
325315To compile this plugin and build the .jar locally, checkout the
326316source code and execute:
327317
@@ -351,7 +341,7 @@ buildscript {
351341 }
352342 }
353343 dependencies {
354- classpath "com.github.mrsarm:jshell-plugin:1.0 .0"
344+ classpath "com.github.mrsarm:jshell-plugin:1.1 .0"
355345 }
356346}
357347
@@ -366,11 +356,11 @@ This is a fork of the project https://github.com/bitterfox/jshell-gradle-plugin
366356I forked it because the original project is not receiving patches
367357and this version solves some issues and adds the following features:
368358
369- - It works with ** multi-module projects**
359+ - It works with ** multi-module projects** .
370360 - There is no need to set the env variable ` JAVA_OPTS ` with a bunch
371- of arguments _ "--add-exports jdk.jshell/jdk.intern..."_
372- - It allows to run at the beginning of the session a _ .jsh_ startup script
373- - Special support to the ** Spring Framework**
361+ of arguments _ "--add-exports jdk.jshell/jdk.intern..."_ .
362+ - It allows to run at the beginning of the session a _ .jsh_ startup script.
363+ - Special support to the ** Spring Framework** .
374364
375365** Project** : https://github.com/mrsarm/jshell-plugin
376366
@@ -382,4 +372,4 @@ and this version solves some issues and adds the following features:
382372
383373### License
384374
385- - (2020) [ Apache Software License 2.0] ( https://www.apache.org/licenses/LICENSE-2.0 ) .
375+ - (2020-2021 ) [ Apache Software License 2.0] ( https://www.apache.org/licenses/LICENSE-2.0 ) .
0 commit comments