在java11中使用Nashorn engine,会有警告Warning: Nashorn engine is planned to be removed from a future JDK release,
共有两种配置方式:
1.设置JVM启动参数:
-Dnashorn.args=--no-deprecation-warning
2.在java代码设置设置系统变量:(推荐,直接加在代码块中即可)
System.setProperty("nashorn.args","--no-deprecation-warning");