mrsarm / jshell-plugin Goto Github PK
View Code? Open in Web Editor NEWGradle plugin to explore your code and dependencies with in jshell
Home Page: https://plugins.gradle.org/plugin/com.github.mrsarm.jshell.plugin
License: Apache License 2.0
Gradle plugin to explore your code and dependencies with in jshell
Home Page: https://plugins.gradle.org/plugin/com.github.mrsarm.jshell.plugin
License: Apache License 2.0
Added the plugin in the following version:
id "com.github.mrsarm.jshell.plugin" version "1.0.0-RC1"
Running the command:
./gradlew --no-daemon build -x test --console plain jshell
Leads to it successfully building and starting JShell but i doesn't grant me interactive input and stops as "BUILD SUCCESSFUL" immediately after:
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/6.3/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing
> Configure project :
:jshell task :classes not found, be sure to compile the project first
> Task :compileJava UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :bootJar UP-TO-DATE
> Task :jar SKIPPED
> Task :assemble UP-TO-DATE
> Task :check
> Task :build
> Task :jshell
| Welcome to JShell -- Version 14
| For an introduction type: /help intro
BUILD SUCCESSFUL in 11s
4 actionable tasks: 1 executed, 3 up-to-date
Some infos about my system:
➜ service java --version
openjdk 14 2020-03-17
OpenJDK Runtime Environment (build 14+36-1461)
OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)
➜ service ✗ ./gradlew --version
------------------------------------------------------------
Gradle 6.3
------------------------------------------------------------
Build time: 2020-03-24 19:52:07 UTC
Revision: bacd40b727b0130eeac8855ae3f9fd9a0b207c60
Kotlin: 1.3.70
Groovy: 2.5.10
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 14 (Oracle Corporation 14+36-1461)
OS: Mac OS X 10.15.3 x86_64
I've got everything in my project using Java17:
% echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/amazon-corretto-17.jdk/Contents/Home/
% which java
/Library/Java/JavaVirtualMachines/amazon-corretto-17.jdk/Contents/Home/bin/java
% which jshell
/Library/Java/JavaVirtualMachines/amazon-corretto-17.jdk/Contents/Home/bin/jshell
Similarly, my build.gradle
specifies Java17 in all the right places and if I call System.getProperty("java.version")
, it prints "17.0.1".
But, when I run ./gradlew --console plain jshell
, I get this:
...
> Task :jshell
| Welcome to JShell -- Version 11.0.7
| For an introduction type: /help intro
jshell>
Is this configurable somewhere?
Any thoughts or possible ways to get some form of command-line editing and/or history working with this?
I would love Emacs keys, but simply having the ability to up-arrow/down-arrow for history, and more importantly left-arrow/right-arrow for inline editing of the command.
Recommended remediation for gradle plugin:
pathSet = pathSet.findAll{ it.isDirectory() || it.toString().endsWith('.jar') }
[prior to the join()]
Our specific problem is that hk2-jar (org.glassfish.ha/ha-api/3.1.12/*/ha-api-3.1.12.hk2-jar) is being pulled into our classpath, and it is not an actual jar file.
Even when running
./gradlew --console plain classes jshell
I still get the message
:jshell task :classes not found, be sure to compile the project first
I haven't been able to figure out what could be causing this. Could you point me in the right direction?
I'm using Java 13.0.1 and Gradle 6.5 on macOS Catalina (10.15.4).
When writing to stdout using for instance System.out.println
, the line is printed as appended to the end of the line, instead of on a new line of its own:
println(1)1
I would expect a new line after println:
println(1)
1
Is this a known problem or something related to my local setup?
Thanks!
jshell> int a = 100
when I type left arrow key, as follows
jshell> int a = 100^[[D
Hi,
When starting the gradle jshell plugin, seems to print a regular tab, instead of triggering code completion. If I launch jshell directly, tab works fine.
I'm under linux, and tried to play with TERM variable a bit, but didn't succeed.
There might be something I'm missing. Could you help me, or point me to a resource to help me.
Thanks in advance
hello
plugin is not working in Windows.
jshell is started, but there is no my classes around.
In windows, if classpath is sent as a one string, multiple dirs and jars are separated by the ; char, not by : char as in linux.
is this handled correctly in your plugin?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.