JShell won't do anything using Git Bash

I installed Java9 (the version currently available on the Oracle website ) for Windows (Windows 10 x64 Professional, updated, works as a virtual machine vmware-> VMware Workstation 12). I added jdk\binto User Path and tried to use Git Bash to execute commands, but even if it JShellstarts, it will not execute any command after clicking Enter, it just sits there, doing nothing.

Interestingly, it works fine with the default Windows command line CMDor Powershell. If I remember Git Bash correctly, this is Cygwin . What could be the reason for this?

In addition, it is not directly related to JShell, but I had similar problems on another machine with some command line tools, for example JHipster (works on CMD, but not on GitBash).

Mandatory screenshot: -

enter image description here

Edit: Use jshell -vdoes not matter. In addition, using any of the auxiliary REPL commands, such as /helpor /help intro, causes the shell to also stop.

+4
source share
1 answer

I had the same problem. The solution is simple:

"If you use git bash as a shell on Windows, add winpty before calling jshell ..."

: https://kichwacoders.com/2017/05/25/woohoo-java-9-has-a-repl-getting-started-with-jshell-and-eclipse-january/

jshell git Bash:

jshell failing

jshell git bash winpty:

jshell working with winpty

, , JHipster?

[, ]

+6

Source: https://habr.com/ru/post/1686679/


All Articles