I am developing Java environment using vscode and maven, but I am using pom.xml dependency
<dependency>
<groupId>io.genetics</groupId>
<artifactId> genetics</artifactId>
<version>7.0.0</version>
</dependency>
When I added and compiled libraries as shown in , I got the following error.
[ERROR]/c:/Users/.../demo/src/main/javamaven-3.8.5\repository\io\genetics\jenetics\7.0.0\genetics-7.0.0.jar(io/genetics/BitChromosome.class) is incorrect
ERROR class file version 61.0 is incorrect.Must be 52.0
ERROR Delete it or verify that it is in the correct subdirectory of the class path.
I don't know what the class file version refers to and what I have to do to compile it.
I deleted the import statement and I could compile it, so I think there might be a problem with the library version, but I'm not sure.
Could you tell me the cause and action?
"Class File Version" refers to which version of JVM was compiled.
The correspondence between the class file version and the Java version can be found in Specification .
The error message appears because your library genetics
is being built for Java 17, but you are trying to build for Java 8 (typically using JDK8).
There are two options for dealing with this problem.
genetics
for Java 8
v5.2.0
appears to be the final Java 8 compatible versionv5.2.0
appears to be the final Java 8 compatible versionIf you want to take the former action, you may want to rewrite the version number shown in the questionnaire.
<dependency>
<groupId>io.genetics</groupId>
<artifactId> genetics</artifactId>
<version> 5.2.0</version>
</dependency>
For the latter, set up JDK17 (or JDK18) and then target Java17 (or 18) with the maven-compiler-plugin
option
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
610 Uncaught (inpromise) Error on Electron: An object could not be cloned
577 PHP ssh2_scp_send fails to send files as intended
890 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
600 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.