赞
踩
使用idea
启动一个SpringBoot
项目的时候,控制台出现了如下的警告⚠️:
Java HotSpot(TM) 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
我的jdk
版本为15
,SpringBoot
版本为2.3.5.RELEASE
。
在jdk13及以后的版本中弃用这些选项有助于防止用户运行违反JVM规范的代码,这会使他们的应用程序容易受到恶意代码的攻击,所以jdk版本在13以前的是没有这个警告的,这个警告来源于13及以后的一个版本设置问题。
(2020年11月28日)补充:今天刚好在看JVM的类加载过程。-Xverify:none
这个设置和链接过程中的验证阶段有关,这个设置可以关闭大部分类的类验证措施,以缩短虚拟机的类加载时间。当然啦如果这个程序已经被反复编译过,说明其实也没由太大的毛病了,所以也不太需要这个验证了。但是官方在jdk13中废弃了这个选项显然还是出于对Java虚拟机安全方面的考虑。
Deprecated Java Options -Xverifynone and -noverify
The Java options
-Xverify:none
and-noverify
have been deprecated in this release. The options will continue to work as intended but will generate the following warning when used:warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
- 1
Deprecating these options helps prevent users from running code that violates the JVM Specification, which can leave their applications open to malicious code.
Users who need to run without startup verification can use AppCDS to archive their classes. The classes are verified during archiving and avoid verification at runtime.
Note that if you encounter issues while using either of these options, it is very likely that you will be required to reproduce the problem without using these options before Oracle Support can assist with an investigation.
以下为idea中的操作:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。