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

前端 未结 12 910
梦谈多话
梦谈多话 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:41

    In my case, using Java 11, I had:

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

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

     public List 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.

提交回复
热议问题