Gitpod: [Java] `jshell` doesn't work (no user input possible)

Created on 17 Oct 2019  路  8Comments  路  Source: gitpod-io/gitpod

Describe the bug
When you try to run jshell, the CLI starts, but then refuses to take any user input:

Screenshot 2019-10-17 at 16 06 32

Even ^C or ^D don't work, the only way to kill it is to open another Terminal and run killall jshell.

Originally reported here.

To Reproduce

  1. In any Gitpod workspace, run sdk use java 9.0.4-open (install if necessary)
  2. Run jshell
  3. Try to type anything into it. Nothing works.

Expected behavior
jshell should work.

I wonder if this is a bug with https://github.com/eclipse-theia/theia or even https://github.com/xtermjs/xterm.js.

bug terminal theia

All 8 comments

As a workaround, I found that you can pipe commands to it:

$ echo "/help" | jshell
Picked up JAVA_TOOL_OPTIONS: -Xmx2254m
|  Welcome to JShell -- Version 9.0.4
|  For an introduction type: /help intro

jshell> /help
|  Type a Java language expression, statement, or declaration.
|  Or type one of the following commands:
[...]
$ 

It runs the command and then exits, giving back control of the Terminal.

@jankeromnes can you send a repo with it installed

@JesterOrNot jshell is part of Java by default (at least Java 9). The reproduction instructions work in every Gitpod workspace.

Sorry my bad!

image
It doesn't seem to be there

Ah, so it's not in the default Java version.

But if you run sdk use java 9.0.4-open first, you'll have jshell.

image

Then you can press Enter to install Java 9. :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kittaakos picture kittaakos  路  3Comments

hidehiro98 picture hidehiro98  路  3Comments

bytekast picture bytekast  路  3Comments

Kreyren picture Kreyren  路  3Comments

iksaif picture iksaif  路  3Comments