I installed Java9 (currently available version on Oracle's site) for Windows (Windows 10 x64 Professional, up to date as well, runs as a vmware virtual machine->VMware Workstation 12). I added the jdk\bin
to the User's Path and tried to use Git Bash to execute commands, but even though JShell
launches, it won't execute any command after pressing Enter
, it just sits there without doing anything.
Interesting thing is it works perfectly with Windows's default command line CMD
or Powershell
. If I recall correctly Git Bash is Cygwin based. What can be the cause of this?
Also, It is not connected directly to JShell
, but I had similar problems on a different machine with some command line tools, like JHipster (works on CMD but not on GitBash).
Obligatory screenshot:-
Edit.: Using jshell -v
does not make a difference. Also, using any of the REPL helper commands, like /help
or /help intro
makes the shell to stop too.
I had the same problem. The solution is simple:
"If you are using git bash as your shell on Windows, add winpty before calling jshell ...".
This is the source: https://kichwacoders.com/2017/05/25/woohoo-java-9-has-a-repl-getting-started-with-jshell-and-eclipse-january/
Here's jshell failing in Git Bash:
And here's jshell working in Git Bash when using winpty:
And maybe this approach will also fix your JHipster problem?
[Updated to show clearer screen shots]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With