Posted June 22, 20223 yr Hello, I am working on a programming mod in Minecraft that is designed for coding Java, and I am using JShell to evaluate the statements. The issue happens when instantiating JShell with: JShell.builder().build(); With the stack trace: Caused by: java.lang.IllegalStateException: Launching JShell execution engine threw: No ExecutionControlProvider with name 'failover' and parameter keys: [0, 1, 2] at jdk.jshell.JShell.<init>(JShell.java:139) ~[jdk.jshell:?] {} at jdk.jshell.JShell$Builder.build(JShell.java:405) ~[jdk.jshell:?] {} .. .. This is caused by the ServiceLoader not finding any ExecutionControlProviders. After looking into what a ServiceLoader is (https://www.logicbig.com/tutorials/core-java-tutorial/java-se-api/service-loader.html) and coming across this StackOverflow: (https://stackoverflow.com/questions/71023598/serviceloader-not-finding-any-services) I'm lead to believe that Forge or something to do with the minecraft development environment is not loading the same things as a default java environment (where I've done my testing this far) (Below is the service loader screenshot, the IllegalArgumentException is thrown since there are no ExecutionControlProviders returned from the ServiceLoader.load(ExecutionControlProvider.class)) I have tried an alternate way to load a class with ServiceLoader.load(ExecutionControlProvider.class, LaunchClassLoaderUtil.class.getClassLoader()) // also tried disabling my mixin annotation processor in build.gradle // annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' I'm not super familiar with how all this stuff is set up, and was wondering if anyone had any ideas or suggestions on how to get this working? I've looked through a Minecraft JShell Plugin: (https://github.com/bramhaag/JShell/blob/cc2b8ae1191ab2e1b947a122430c586ed1c5ee81/src/main/java/me/bramhaag/jshell/JShellWrapper.java#L246 and https://www.spigotmc.org/resources/jshell.47753/) but there doesn't seem to be any special configuration there Thanks for taking the time to read! Hopefully we can figure something out...
June 25, 20223 yr Author Guess I'll pivot to using an expression evaluator instead of a Java evaluator..
June 7, 20232 yr Just worked at this for a while after reading this. Was able to find success with: JShell jShell = JShell.builder().executionEngine(new LocalExecutionControlProvider(), new HashMap<>()).build();
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.