The /reset command hangs after setting a startup script

Kishori Sharan kishori.sharan at gmail.com
Fri Feb 17 04:02:37 UTC 2017


Hello,
I am using trying to set a startup script for JShell and the jshell prompt
hangs. Here are the commands:


C:\Test>java -version
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+157)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+157, mixed mode)

C:\Test>jshell
|  Welcome to JShell -- Version 9-ea
|  For an introduction type: /help intro

jshell> /set start -retain startup.jsh

jshell> /reset
|  Resetting state.


The /reset command prints a message that it is resetting state and hangs
for a while and start printing stack trace. The startup.jsh file contains a
command to set the class path. The command inside the startup.jsh file is:

/env -class-path C:\Test\com.abc.jshell\build\classes

The old command, /classpath, worked before.

I cannot restart jshell if I kill the jshell session. I have to remove the
jshell entries from the registry, before I can use jshell again. After few
minutes, I see the following exception stack trace that suggests that
jshell is in an infinite loop: I could not get the beginning of the stack
trace.

at
jdk.jshell/jdk.internal.jshell.tool.JShellTool.startUpRun(JShellTool.java:1017)
        at
jdk.jshell/jdk.internal.jshell.tool.JShellTool.resetState(JShellTool.java:975)
        at
jdk.jshell/jdk.internal.jshell.tool.JShellTool.doReload(JShellTool.java:2537)
        at
jdk.jshell/jdk.internal.jshell.tool.JShellTool.cmdEnv(JShellTool.java:2533)
        at
jdk.jshell/jdk.internal.jshell.tool.JShellTool.lambda$new$42(JShellTool.java:1559)
        at
jdk.jshell/jdk.internal.jshell.tool.JShellTool.processCommand(JShellTool.java:1138)
        at
jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1080)
        at
jdk.jshell/jdk.internal.jshell.tool.JShellTool.startUpRun(JShellTool.java:1017)
        at
jdk.jshell/jdk.internal.jshell.tool.JShellTool.resetState(JShellTool.java:975)
        at
jdk.jshell/jdk.internal.jshell.tool.JShellTool.doReload(JShellTool.java:2537)
        at
jdk.jshell/jdk.internal.jshell.tool.JShellTool.cmdEnv(JShellTool.java:2533)
        at
jdk.jshell/jdk.internal.jshell.tool.JShellTool.lambda$new$42(JShellTool.java:1559)
        at
jdk.jshell/jdk.internal.jshell.tool.JShellTool.processCommand(JShellTool.java:1138)
        at
jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1080)
        at
jdk.jshell/jdk.internal.jshell.tool.JShellTool.startUpRun(JShellTool.java:1017)
        at
jdk.jshell/jdk.internal.jshell.tool.JShellTool.resetState(JShellTool.java:975)
        at
jdk.jshell/jdk.internal.jshell.tool.JShellTool.doReload(JShellTool.java:2537)


Thanks
Kishori


More information about the kulla-dev mailing list