Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8175304

JShell tool: The /reset command hangs after setting a startup script

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 9
    • tools
    • b160
    • generic
    • generic
    • Verified

        kishori.sharan wrote in http://mail.openjdk.java.net/pipermail/kulla-dev/2017-February/001926.html :

        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)

              rfield Robert Field (Inactive)
              shinyafox Shinya Yoshida
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: