【发布时间】:2019-09-18 23:59:25
【问题描述】:
我正在使用jdk-10.0.2 和gradle 4.7,我在构建我的项目时遇到了这个错误。
Unable to find method 'sun.misc.Unsafe.defineClass(Ljava/lang/String;[BIILjava/lang/ClassLoader;Ljava/security/ProtectionDomain;)Ljava/lang/Class;'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
【问题讨论】:
-
在 JDK 9 中删除了已弃用的 Unsafe.defineClass,建议使用 Lookup.defineClass。请参阅 JDK 9 发行说明:oracle.com/technetwork/java/javase/…
标签: java spring-boot gradle