zoukankan      html  css  js  c++  java
  • idea中解决Error:java: Compilation failed: internal java compiler error的问题

    项目中,使用gradle做项目构建,当我们想更改JDK的版本时,报以下错误:

    Information:Using javac 1.8.0_111 to compile java sources
    Information:java: javacTask: 源发行版 1.8 需要目标发行版 1.8
    Information:java: Errors occurred while compiling module 'Spring_1_main'
    Information:2018/1/4 18:46 - Compilation completed with 1 error and 0 warnings in 3s 768ms
    Error:java: Compilation failed: internal java compiler error

    其实有几个地方要改:

    1. 更改build.gradle文件

        sourceCompatibility = 1.8

    2. 更改.idea/compiler.xml文件

    <bytecodeTargetLevel>
          <module name="common_main" target="1.8" />
          <module name="common_test" target="1.8" />
          <module name="questionnaire_main" target="1.8" />
          <module name="questionnaire_test" target="1.8" />
    </bytecodeTargetLevel>

    3. 更改File->Project Structure->Project Settings->Modules->项目名称->右侧的Dependencies->Module SDK

        

    4. 在Settings->Buile,Execution,Deployment->Compiler->Java Compiler设置Module的Target bytecode version

  • 相关阅读:
    Java Number & Math 类
    excel小技巧-转置(表的横向纵向倒过来)
    excel小技巧-提取填充
    excel小技巧-分列
    Java switch case语句
    if...else
    12.15个人总结
    12.9个人总结
    11.29个人总结
    11.25日个人总结
  • 原文地址:https://www.cnblogs.com/feiyujun/p/8386249.html
Copyright © 2011-2022 走看看