Which versions of Java are supported by EvoSuite?
I am running a maven build, following the instructions on the EvoSuite maven plugin page.
However, the build fails with the following message:
Failed to execute goal org.evosuite.plugins:evosuite-maven-
plugin:0.1.1:generate (default-cli) on project simple: Execution default-cli of
goal org.evosuite.plugins:evosuite-maven-plugin:0.1.1:generate failed: Unable
to load the mojo 'generate' in the plugin 'org.evosuite.plugins:evosuite-maven-
plugin:0.1.1' due to an API incompatibility:
org.codehaus.plexus.component.repository.exception.ComponentLookupException:
org/evosuite/maven/GenerateMojo : Unsupported major.minor version 51.0
EvoSuite does support Java 7. The error message that you get seems like the Maven process you used is not using Java 7. You need to be sure that "mvn" is using the right Java version. Use mvn -version to check which one you are using.
See related post: java.lang.UnsupportedClassVersionError: Unsupported major.minor version 51.0 (unable to load class frontend.listener.StartupListener)
NO,at least JAVA8.You can go to the website of Evosuite to learn more.
Related
I am facing problem while trying to run maven build with JDK6. I am running build inside docker container with JDK6 and Maven.
Do I get it right, that the plugins are not compatibile with JDK6 version and I should use lower version of help plugin? I cannot change JDK version to higher, I ran into this problem while trying to enable bulding project with JDK6, so I want to solve this problem.
error message from Maven:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate (default-cli) on project security-component: Execution default-cli of goal org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate failed: Unable to load the mojo 'evaluate' in the plugin 'org.apache.maven.plugins:maven-help-plugin:3.2.0' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/apache/maven/plugins/help/EvaluateMojo : Unsupported major.minor version 51.0
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-help-plugin:3.2.0
mvn -version output:
Maven home: /usr/share/maven
Java version: 1.6.0_41, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-6-openjdk-amd64/jre
indeed problem was in too high version of help plugin, I lower it to 2.2 and its fine
adding direct path to selected version of help plugin worked for me:
$MVN_CMD org.apache.maven.plugins:maven-help-plugin:2.2:evaluate
This question already has answers here:
Run SonarScanner analysis with Java 11, run target code with Java 8
(3 answers)
Closed 1 year ago.
I have installed latest version of SonarQube using Java 11 pointed from its config i.e. wrapper.config. I have read that it can analyze code even written in Java 8, but I am getting following exception:
[ERROR] Failed to execute goal
org.sonarsource.scanner.maven:sonar-maven-plugin:3.8.0.2131:sonar
(default-cli) on project ptf-parent: Execution default-cli of goal
org.sonarsource.scanner.maven:sonar-maven-plugin:3.8.0.2131:sonar
failed: An API incompatibility was encountered while executing
org.sonarsource.scanner.maven:sonar-maven-plugin:3.8.0.2131:sonar:
java.lang.UnsupportedClassVersionError:
org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled
by a more recent version of the Java Runtime (class file version
55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Currently, my code is build using Java 8 and I want to analyze using the latest SonarQube version.
I am running analyzer from Eclipse IDE. All my projects are configured to use Java 8 and Maven 3.8.2 to use sonar parameters to push report on SonarQube, but it does not work.
Below are the parameters I am providing in Eclipse Run as Maven build:
-e clean install sonar:sonar -Dsonar.java.jdkHome=C:\Program Files\Java\jdk1.8.0_251 -Dsonar.project
-Dsonar.projectKey=TESTPROJECT -Dsonar.host.url=http://localhost:9000 -Dsonar.login=a2603f6cd079e4a7833179333333333333333333e
According to sonarqube community, you should try the following:
Edit conf\wrapper.conf, specifically the wrapper.java.command to following:
wrapper.java.command=C:\Program Files\Java\open jdk-11.0.2\bin\java
#wrapper.java.command=java
We have upgraded from 7.6>7.9>8.9>9.0.
And now we are facing the same issue,
plugin:3.9.0.2155:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar: java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I have gone through the documentation https://docs.sonarqube.org/latest/analysis/languages/java/#header-3, but how can we user sonar.java.jdkHome and where? And this jdk should be on jenkins slave or sonarqube server?
We dont use the sonarqube properties file, we have jenkins build where we have maven config and only sonar:sonar for scans. How can we manage this scenario.
Thanks in advance.
Since SonarQube 9.0 analysis must be done using JDK11. This is one of the breaking changes in 9.0, see official documentation.
I have cloned a Maven repository which I wish to use and build on my machine. I used to be able to build this particular project, but now when I choose maven install, it gives me this error
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0
Which is really strange. I know that this maven project uses java 6, and it shows so in the pom.xml, but my machine already has java 6 installed. In fact, the project says it's using it. What's going on?
Although your project uses Java 6, Maven version 3.3.3 (latest at this time) needs Java 7.
Either use Maven 3.2.5 (that uses Java 6) or install Java 7.
Reference:
https://maven.apache.org/docs/history.html
I have Spring-Roo geerated project, that fails to start in jetty via mvn jetty:run
Caused by: java.lang.UnsupportedClassVersionError: com/roo124/domain/Company : Unsupported major.minor version 51.0
What does Unsupported major.minor version mean? And where can I see that 51.0 value?
it means that the classes, you are trying to run, were compiled with a newer version of java than the one you are currently using.
Please check the output of mvn --version and make sure you are using a current JVM.
For more information about the class file version, please check here: https://stackoverflow.com/a/11432195/435583