Skip to content

Commit 1358eec

Browse files
committed
Improve README
1 parent 39f4879 commit 1358eec

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ buildscript {
3636
}
3737
}
3838
dependencies {
39-
classpath "com.github.mrsarm:jshell-plugin:1.0.0-RC1"
39+
classpath "gradle.plugin.com.github.mrsarm:jshell-plugin:1.0.0-RC1"
4040
}
4141
}
4242
@@ -90,6 +90,8 @@ arguments, like:
9090
Troubleshooting
9191
---------------
9292

93+
### JShell warning at startup
94+
9395
If you see this warning and the jshell console does not detect your classes:
9496

9597
> :jshell task :classes not found, be sure to compile the project first
@@ -102,6 +104,28 @@ Gradle command:
102104

103105
$ gradle --no-daemon --console plain classes jshell
104106

107+
### I have a JDK 9+ installation but my default JDK is the JDK 8 or below
108+
109+
In that case Gradle will try to use the default JDK, and `jshell` is
110+
not available in Java 8 and above. Moreover the steps to change the
111+
default JDK vary depending of your system, but Gradle use the default
112+
JDK except if it's defined the `$JAVA_HOME` environment variable,
113+
so when you enter in a new console where you need to use your Java 9+
114+
installation with Gradle, just export the variable with the path to
115+
the JDK installation, eg:
116+
117+
$ export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
118+
119+
The export will live just whiting the session where is defined,
120+
it does not change your system configuration globally, and calling
121+
to `unset JAVA_HOME` or opening a new session the export will
122+
not have effect anymore.
123+
124+
You can even create an alias in your `~/.profile` / `~/.bashrc`
125+
file like: `alias setjava9='export JAVA_HOME=/System/Library/Java/...'`
126+
to later switch easily to the other distribution calling
127+
`setjava9`.
128+
105129

106130
System Requirements
107131
-------------------
@@ -127,7 +151,7 @@ About
127151

128152
This is a fork of the project https://github.com/bitterfox/jshell-gradle-plugin ,
129153
I forked it because the original project is not receiving patches
130-
and this version solve some issues and adds the following features:
154+
and this version solves some issues and adds the following features:
131155

132156
- It works with **multi-module projects**
133157
- There is no need to set the env variable `JAVA_OPTS` with a bunch of

0 commit comments

Comments
 (0)