Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Generating Test Suite using EvoSuite #476

Open
yz-qiang opened this issue Jun 15, 2024 · 0 comments
Open

Issue with Generating Test Suite using EvoSuite #476

yz-qiang opened this issue Jun 15, 2024 · 0 comments

Comments

@yz-qiang
Copy link

Problem Description

Hello,

I am attempting to generate a test suite for my project using EvoSuite. I have downloaded the evosuite-1.2.0.jar and tried to generate the test suite with the following command:

java -jar evosuite-1.2.0.jar -target target/classes -generateTests -projectCP target/classes

However, I encountered an error:


Picked up JAVA_TOOL_OPTIONS: -Duser.language=en -Duser.country=US
* EvoSuite 1.2.0
* Found 938 matching classes in target target/classes
* Analyzing classpath (generating inheritance tree)
  - target/classes
[MASTER] 22:20:27.331 [main] ERROR EvoSuite - Fatal crash on main EvoSuite process. Class  using seed 1718461227327. Configuration id : null
java.lang.IllegalArgumentException: Unsupported class file major version 65
        at org.evosuite.shaded.org.objectweb.asm.ClassReader.<init>(ClassReader.java:199)
        at org.evosuite.shaded.org.objectweb.asm.ClassReader.<init>(ClassReader.java:180)
        at org.evosuite.shaded.org.objectweb.asm.ClassReader.<init>(ClassReader.java:166)
        at org.evosuite.shaded.org.objectweb.asm.ClassReader.<init>(ClassReader.java:287)
        at org.evosuite.setup.InheritanceTreeGenerator.analyzeClassStream(InheritanceTreeGenerator.java:233)
        at org.evosuite.setup.InheritanceTreeGenerator.createFromClassPath(InheritanceTreeGenerator.java:98)
        at org.evosuite.EvoSuite.generateInheritanceTree(EvoSuite.java:76)
        at org.evosuite.executionmode.TestGeneration.generateTestsTarget(TestGeneration.java:638)
        at org.evosuite.executionmode.TestGeneration.executeTestGeneration(TestGeneration.java:88)
        at org.evosuite.EvoSuite.parseCommandLine(EvoSuite.java:335)
        at org.evosuite.EvoSuite.main(EvoSuite.java:103)

Here is my current java -version:

shell
% java -version
Picked up JAVA_TOOL_OPTIONS: -Duser.language=en -Duser.country=US
openjdk version "21.0.1" 2023-10-17
OpenJDK Runtime Environment (build 21.0.1+12-29)
OpenJDK 64-Bit Server VM (build 21.0.1+12-29, mixed mode, sharing)

Here are the properties in my pom.xml:

xml
<properties>
    <maven.compiler.source>21</maven.compiler.source>
    <maven.compiler.target>21</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Could you please advise on how to resolve this issue? Thank you!

Additionally, I noticed that the EvoSuite homepage states that it supports Java 8 or Java 9. Is it compatible with JDK 17 or JDK 21?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant