Upgrade to JDK8, Error:java:java.lang.ExceptionInInitializerError occurs at compile time

Source: Internet
Author: User

This problem occurs when compiling. Using the 1.7 jdk is fine, but because of the code written by Java8 in the PO master project, resolving the Java8 compatibility issue becomes the preferred solution to this problem.

This log is too simple, only to tell an exception information, this exception occurs mainly because of static class, static variables initialized when the exception occurred, PO Project is an early project, too many static classes, can not directly locate how the exception information is generated, the console also has no output stack, This has caused great inconvenience to the troubleshooting, the first to solve should be to tell the detailed stack information output, can be conveniently located to the root of the problem.

Notice the third infomation,compliation completed with 1 error ..... This means that the exception is generated during the compilation phase, first to look at the idea of the build log. The log directory is

/users/xxxx/library/logs/ideaic2016.1/build-log

Open Bulid.log, you can see the specific exception of the stack information.

From the stack of information,lombok.javac.Javac.getCtcInt should be a class conflict problem, this class should be idea's own class of the exception, is the idea of the bug.

Then the almighty Google Next,

https://intellij-support.jetbrains.com/hc/en-us/community/posts/205434150-idea-2016-3-compile-error-please-help-

The classmate had the same problem and checked the version of my idea, the idea version of this classmate was 2016.3. Po under my:

IntelliJ Idea 2016.1.1

Build #IC -145.597, built on March 29, 2016
jre:1.8.0_40-release-b132 x86_64
JVM:OPENJDK 64-bit Server VM by JetBrains S.R.O

The version also compares this classmate's to be old some, so! Let's upgrade idea! Upgrade went, will come to PO is not already resolved!

Upgrade to JDK8, Error:java:java.lang.ExceptionInInitializerError occurs at compile time

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.