EvoSuite / evosuite

EvoSuite - automated generation of JUnit test suites for Java classes
http://www.evosuite.org
GNU Lesser General Public License v3.0
824 stars 341 forks source link

Failed to run EvoSuite on Java 17 #433

Open isadoracardosozup opened 1 year ago

isadoracardosozup commented 1 year ago

I am trying to run EvoSuite in a Java 17 project, but it is not working since, currently, EvoSuite only supports Java up to 11. Has anyone had success running EvoSuite in Java 17? How much effort do we need to make EvoSuite work on Java 17?

Below, you can see the EvoSuite response when trying to run in Java 17 project:

* Error while initializing target class: **class** has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
* Computation finished
[MASTER] 17:12:01.723 [logback-2] ERROR TestSuiteGenerator - Problem for **class**. Full stack:
java.lang.ClassNotFoundException: **class** has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
        at org.evosuite.instrumentation.InstrumentingClassLoader.instrumentClass(InstrumentingClassLoader.java:158)
        at org.evosuite.instrumentation.InstrumentingClassLoader.loadClass(InstrumentingClassLoader.java:126)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:398)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.evosuite.testcase.statements.MethodStatement$1.execute(MethodStatement.java:256)
        at org.evosuite.testcase.statements.AbstractStatement.exceptionHandler(AbstractStatement.java:165)
        at org.evosuite.testcase.statements.MethodStatement.execute(MethodStatement.java:219)
        at org.evosuite.testcase.execution.TestRunnable.executeStatements(TestRunnable.java:286)
        at org.evosuite.testcase.execution.TestRunnable.call(TestRunnable.java:192)
        at org.evosuite.testcase.execution.TestRunnable.call(TestRunnable.java:49)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.UnsupportedClassVersionError: **class** has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:878)
        at org.evosuite.instrumentation.InstrumentingClassLoader.instrumentClass(InstrumentingClassLoader.java:151)
        ... 17 common frames omitted
[MASTER] 17:12:01.845 [main] ERROR SearchStatistics - No statistics has been saved because EvoSuite failed to generate any test case
[MASTER] 17:12:01.947 [main] ERROR TestGeneration - failed to write statistics data
jain-shreyansh commented 1 year ago

any update on this?

v1d3rm3 commented 11 months ago

Same here

jfrchicanog commented 9 months ago

Hi, we have a version of Evosuite running on Java 17. It is in a private repo but we would be happy to share it once we remove some details we cannot disclose.

crhf commented 8 months ago

@jfrchicanog hi, professor, have you got a chance to do this?

JulienDiTria commented 8 months ago

@jfrchicanog Hi i'd also be interested to go on java17, if you have a version that run on that ! let me know :)

kenberland commented 7 months ago

Yes, please share the Java 17 patch.

MichelePolo commented 1 month ago

I'm waiting with the others in this list of commente.

Thank you very much