mport java.util.HashMap; 
import java.util.Map; 

import jdk.jshell.JShell; 
import jdk.jshell.execution.DirectExecutionControl; 
import jdk.jshell.spi.ExecutionControl; 
import jdk.jshell.spi.ExecutionControlProvider; 
import jdk.jshell.spi.ExecutionEnv; 

public class Main { 
public static void main(String[] args) { 
JShell jshell = JShell.builder().executionEngine(new ExecutionControlProvider() { 
public ExecutionControl generate(ExecutionEnv env, Map<String, String> param) throws Throwable { 
return new DirectExecutionControl(); 
} 

public String name() { 
return "Name"; 
} 

}, new HashMap<>()).build(); 

jshell.eval("throw new java.io.IOException();"); 
} 
} 