In the project, use gradle to build the project. When we want to change the version of the JDK, the following error is reported:
Information:Using javac 1.8.0_111 to compile java sources
Information:java: javacTask: source release 1.8 requires target release 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
In fact, there are a few things that need to be changed:
1. Change the build.gradle file
sourceCompatibility = 1.8
2. Change the .idea/compiler.xml file
< 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. Change File->Project Structure->Project Settings->Modules->Project name->Dependencies->Module SDK on the right
4. Set the Target bytecode version of Module in Settings->Buile, Execution, Deployment->Compiler->Java Compiler
Read More:
- [Solved] IntelliJ IDEA Compile Error: Errorjava Compilation failed internal java compiler error
- Idea Error: java: java.lang.OutOfMemoryError: GC overhead limit exceeded
- [Solved] IDEA Start Project Error: Abnormal build process termination:Could not create the Java Virtual Machine.
- Hive ERROR Failed with exception java.io.IOException:java.lang.IllegalArgumentException
- [Solved] IDEA JSP File out.println Error: Cannot resolve method ‘println(java.lang.String)’
- [Solved] Android Error: Compilation failed; see the compiler error output for details
- [Solved] java.lang.noclassdeffounderror when idea runs Flink: org/Apache/flick/API/common/executionconfig
- [Solved] java.lang.reflect.InaccessibleObjectException: Unable to make protected java.net.http.HttpRequest()…
- [Solved] internal compiler error Killed (program cc1plus)
- IDEA Error: org.jetbrains.jps.builders.java.dependencyView.TypeRepr$PrimitiveType cannot be cast t
- g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocess
- [Solved] Response Export error on submit request on future invoke, java.lang.OutOfMemoryError: Java heap space
- [Solved] c++: internal compiler error: Killed (program cc1plus)
- [Solved] jetson Compile pytorch Error: internal compiler error: Segmentation fault
- IDEA Create Scala Project Error: scalac: Error: Error compiling the sbt component ‘compiler-interface-2.10.0-52.0‘
- [Solved] Non-fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: library “libmmkv.so“ not found
- [Solved] Failed to bind properties under ‘spring.datasource.type‘ to java.lang.Class<javax.sql.DataSource>
- [Solved] Idea 2020 uses SVN error: ‘C: \ program’ is not an internal or external command
- [Exception] javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed