IntelliJ IDEA tells me “Error:java: Compilation failed: internal java compiler error idea”

前端 未结 12 911
梦谈多话
梦谈多话 2020-12-13 08:17

When I compile a Java project using IntelliJ IDEA, it gives me the following output (and error):

Information:Eclipse compiler 4.6.2 was used to compile java          


        
相关标签:
12条回答
  • 2020-12-13 08:40

    For me the module's target bytecode version was set to 5. I changed it to 8 and the error is gone:

    0 讨论(0)
  • 2020-12-13 08:41

    In my case, using Java 11, I had:

     public List<String> foo() {
       ...
       return response.readEntity(new GenericType<List<String>>() {});
    

    and Intellij suggested I should use <> instead of GenericType<List<String>>, as such:

     public List<String> foo() {
       ...
       return response.readEntity(new GenericType<>() {});
    

    I did that in four functions and the project stopped compiling with an internal compiler error, reverted and it compiled again. Looks like a bug with type inference.

    0 讨论(0)
  • 2020-12-13 08:41

    Changing the Language Level in the Project Settings (Ctrl + Alt + Shift + S) to Java 8 solved the problem for me

    0 讨论(0)
  • 2020-12-13 08:42

    I changed my compiler to Eclipse and run my project. Afterwards changed back to Javac and problem solved. I don't know exact problem but it can help who is looking for solution.

    0 讨论(0)
  • 2020-12-13 08:42

    What worked for me is to update the Open JDK version

    0 讨论(0)
  • 2020-12-13 08:45

    I solved this issue by increasing the default value(700) of Build process heap size on IntelliJ's compiler settings.

    0 讨论(0)
提交回复
热议问题