在java11中使用Nashorn engine,会有警告Warning: Nashorn engine is planned to be removed from a future JDK release,关闭这个警告可以通过设置--no-deprecation-warning来实现。
共有两种配置方式:
1.设置JVM启动参数:
-Dnashorn.args=--no-deprecation-warning
2.在java代码设置设置系统变量:
System.setProperty("nashorn.args","--no-deprecation-warning");