When using gradle project, the following situations occur during the process of building a file:
> Task :compileJava
/home/user_1/idea-program/avro-car-sensor-simulator-master/src/main/java/com/hivemq/CarDataPayloadGenerator.java:7: error: cannot access PluginPayloadGenerator
import com.hivemq.simulator.plugin.sdk.load.generators.PluginPayloadGenerator;
^
bad class file: /home/user_1/idea-program/avro-car-sensor-simulator-master/device-simulator-plugin-sdk-1.0.0.jar(com/hivemq/simulator/plugin/sdk/load/generators/PluginPayloadGenerator.class)
class file has wrong version 55.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
According to the above error conditions:
“bad class file: /home/user_1/idea-program/avro-car-sensor-simulator-master/device-simulator-plugin-sdk-1.0.0.jar(com/hivemq/simulator/plugin/sdk/load/generators/PluginPayloadGenerator.class) class file has wrong version 55.0, should be 52.0 Please remove or make sure it appears in the correct subdirectory of the classpath.”
It is possible to know that the problem occurs in the idea-program/avro-car-sensor-simulator-master/device-simulator-plugin-sdk-1.0.0.jar, which requires version 55, while the current environment is version 52.
(Reason for the error: running a class file compiled with a JDK of 11 using a JRE with a JDK of 8)
The corresponding version of Java is as follows:
ava SE 13 = 57,
Java SE 12 = 56,
Java SE 11 = 55,
Java SE 10 = 54,
Java SE 9 = 53,
Java SE 8 = 52,
Java SE 7 = 51,
Java SE 6.0 = 50,
Java SE 5.0 = 49,
JDK 1.4 = 48,
JDK 1.3 = 47,
JDK 1.2 = 46,
JDK 1.1 = 45
After configuring java11, try again and compile successfully
Read More:
- [Solved] Invalid Gradle JDK configuration found. Open Gradle Settings Change JDK location
- [Solved] O2oa compile error: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin
- [Solved] Resource compilation failed (Failed to compile values resource file…
- Error in gradle7 testcompile compilation [How to Solve]
- MVN compile Error: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin…
- Kotlin activity Startup and Compile Error [How to Solve]
- IDEA Compile Error: java Compilation failed internal java compiler error
- OTA Pack Compile Error: ExternalError: Failed to run signapk.jar: return code 1:Error: A JNI error has occurred
- [Solved] IDEA Compile Error: Error:java: Compilation failed: internal java compiler error
- [Solved] IDEA Compile Error: java: Compilation failed: internal java compiler error
- [Solved] Maven Multi-Project Compile Error: The POM for xxx is invalid
- [Solved] IDEA java compile error: Error:java: Compilation failed: internal java compiler error
- IDEA Compile Error: Error:java: Compilation failed: internal java compiler error
- [Solved] Maven compile error: Blocked mirror for repositories
- [Solved] IDEA Compile Lombok to Generate getter/setter Error
- [Solved] Android project Compile error: error processing kotlin-stdlib-1.6.0.jar
- [Solved] Ceres Compile error: ‘integer_sequence’ is not a member of ‘std‘
- Maven project running servlet jump JSP error: HTTP status 500 – unable to compile class for JSP
- [Solved] spring source code compile error: target package does not exist
- [Solved] SpringCloud Compile Error: java: JPS incremental annotation processing is disabled. Compilation results on partial recompilation may be inaccurate.