ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName("js"); engine.put("age", 21); engine.eval("if (age >= 18){ " + " print('Old enough to vote!'); " + "} else {" + " print ('Back to school!');" + "}"); |
欢迎光临 EaBIM (https://eabim.net/) | Powered by Discuz! X3.2 |