jshell-scriptengine icon indicating copy to clipboard operation
jshell-scriptengine copied to clipboard

JShell script engine for Java (JSR-223 compatible)

Results 5 jshell-scriptengine issues
Sort by recently updated
recently updated
newest added

i want to use this plugin in a webapp, and most of them use proxies for classes for various reasons, also i want to have the option to test thing...

here is some code: ``` private static void runJShellBindingExample2() { try { ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName("jshell"); String script = "" + "if (inputA != null...

wontfix

Trying to get a small sample to work with modules. ``` module TestJShell { requires java.scripting; requires java.logging; requires jdk.jshell; // required? requires ch.obermuhlner.scriptengine.jshell; opens org.example to ch.obermuhlner.scriptengine.jshell; exports org.example...

evaluating this: ``` var foo="dfsf"; ``` I get this: ``` 00:07:19.969 AWT-EventQueue-0 UtilSwing.eval: rt ex=java.lang.NullPointerException java.lang.NullPointerException at ch.obermuhlner.scriptengine.jshell.JShellCompiledScript.setBindingsValue(JShellCompiledScript.java:84) ``` this is because global bindings are null there: ``` if (!engineBindings.containsKey(name)...

System.out.println("java.version="+System.getProperty("java.version")); System.out.println("java.runtime.name="+System.getProperty("java.runtime.name")); ScriptEngine jshell = new JShellScriptEngine(); Bindings b = jshell.createBindings(); jshell.setBindings(b, ScriptContext.GLOBAL_SCOPE); jshell.setBindings(b, ScriptContext.ENGINE_SCOPE); long start = System.nanoTime(); jshell.eval("long kk = 0L; for(int i=0; i