public void start(String[] args) throws Exception {
        OptionParserCommandLine commandLineArgs = new OptionParserCommandLine();
        options = commandLineArgs.parse(args);
        if (options == null) {
            // Abort
            return;
        }
        startup = commandLineArgs.startup();
        // initialize editor settings
        configEditor();
        // initialize JShell instance
        try {
            resetState();
        } catch (IllegalStateException ex) {
            // Display just the cause (not a exception backtrace)
            cmderr.println(ex.getMessage());
            //abort
            return;
        }
        // Read replay history from last jshell session into previous history
        replayableHistoryPrevious = ReplayableHistory.fromPrevious(prefs);
        // load snippet/command files given on command-line
        for (String loadFile : commandLineArgs.nonOptions()) {
            runFile(loadFile, "jshell");
        }
        // if we survived that...
        if (regenerateOnDeath) {
            // initialize the predefined feedback modes
            initFeedback(commandLineArgs.feedbackMode());
        }
        // check again, as feedback setting could have failed
        if (regenerateOnDeath) {
            // if we haven't died, and the feedback mode wants fluff, print welcome
            if (feedback.shouldDisplayCommandFluff()) {
                hardmsg("jshell.msg.welcome", version());
            }
            // Be sure history is always saved so that user code isn't lost
            Thread shutdownHook = new Thread() {
                @Override
                public void run() {
                    replayableHistory.storeHistory(prefs);
                }
            };
            Runtime.getRuntime().addShutdownHook(shutdownHook);
            // execute from user input
            try (IOContext in = new ConsoleIOContext(this, cmdin, console)) {
                while (regenerateOnDeath) {
                    if (!live) {
                        resetState();
                    }
                    run(in);
                }
            } finally {
                replayableHistory.storeHistory(prefs);
                closeState();
                try {
                    Runtime.getRuntime().removeShutdownHook(shutdownHook);
                } catch (Exception ex) {
                    // ignore, this probably caused by VM aready being shutdown
                    // and this is the last act anyhow
                }
            }
        }
        closeState();
    }
public void start ( String [ ] args ) throws Exception { OptionParserCommandLine commandLineArgs = new OptionParserCommandLine ( ) ; options = commandLineArgs . parse ( args ) ; if ( options == null ) { return ; } startup = commandLineArgs . startup ( ) ; configEditor ( ) ; try { resetState ( ) ; } catch ( IllegalStateException ex ) { cmderr . println ( ex . getMessage ( ) ) ; return ; } replayableHistoryPrevious = ReplayableHistory . fromPrevious ( prefs ) ; for ( String loadFile : commandLineArgs . nonOptions ( ) ) { runFile ( loadFile , "jshell" ) ; } if ( regenerateOnDeath ) { initFeedback ( commandLineArgs . feedbackMode ( ) ) ; } if ( regenerateOnDeath ) { if ( feedback . shouldDisplayCommandFluff ( ) ) { hardmsg ( "jshell.msg.welcome" , version ( ) ) ; } Thread shutdownHook = new Thread ( ) { @ Override public void run ( ) { replayableHistory . storeHistory ( prefs ) ; } } ; Runtime . getRuntime ( ) . addShutdownHook ( shutdownHook ) ; try ( IOContext in = new ConsoleIOContext ( this , cmdin , console ) ) { while ( regenerateOnDeath ) { if ( ! live ) { resetState ( ) ; } run ( in ) ; } } finally { replayableHistory . storeHistory ( prefs ) ; closeState ( ) ; try { Runtime . getRuntime ( ) . removeShutdownHook ( shutdownHook ) ; } catch ( Exception ex ) { } } } closeState ( ) ; }
The entry point into the JShell tool.

@param args the command-line arguments
@throws Exception catastrophic fatal exception