简体   繁体   English

调试ExceptionInInitializerError

[英]Debugging ExceptionInInitializerError

After a Java 10 migration, I am encountering an error java.lang.ExceptionInInitializerError Java 10迁移后,我遇到错误java.lang.ExceptionInInitializerError

With no other info. 没有其他信息。 Error occurs when I try to run/debug the project. 当我尝试运行/调试项目时发生错误。 Where should I begin looking to diagnose this? 我应该从哪里开始诊断呢?

Here is the full output in the console: 这是控制台中的完整输出:

Information:java: Errors occurred while compiling module 'pw-support-server_main'
Information:javac 10.0.2 was used to compile java sources
Information:11/27/2018 6:06 PM - Compilation completed with 1 error and 0 warnings in 2 s 173 ms
Error:java: java.lang.ExceptionInInitializerError

Resolved using the following steps, which are probably very specific to my situation: 使用以下步骤解决了,这些步骤可能非常适合我的情况:

Changes to build.gradle: 对build.gradle的更改:

buildscript {
    dependencies {
        classpath "io.franzbecker:gradle-lombok:1.10"
    }
}

Changed to classpath "io.franzbecker:gradle-lombok:1.14" (update to latest version) 更改为classpath "io.franzbecker:gradle-lombok:1.14" (更新至最新版本)

Added inside of the block allprojects { 在所有项目中添加了allprojects {

lombok {
    version = "1.18.4"
    sha256 = ""
}

The Franzbecker-lombok thing defaults to installing lombok 1.16.20, which has this issue. Franzbecker-lombok默认情况下安装的是lombok 1.16.20,此问题。 Telling gradle to use lombok's latest version solved this. 告诉gradle使用lombok的最新版本解决了此问题。 Getting the right syntax among all the gradle version changes, Java version changes, etc, was just a little confusing. 在所有gradle版本更改,Java版本更改等中获取正确的语法只是有些混乱。

Side note: The issue also occurred on Java 11. 旁注:此问题在Java 11上也发生。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM