You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I built UTBotJava-2023.10 using Java 17, after finding that both Java 8 and Java 11 resulted in build failures.
I added the UTBotJava Maven plugin to an open-source project's pom.xml, then tried to use Maven to run the utbot:generateTestsAndSarifReport task. The target project is still based on Java 8, so I set JAVA_HOME to a Java 8 JDK when running Maven. The utbot:generateTestsAndSarifReport task failed, reporting java.lang.ClassNotFoundException: kotlin.jdk7.AutoCloseableKt. Using a Java 17 JDK when running Maven fails even earlier, as the target application does not compile under Java 17.
To Reproduce
Steps to reproduce the behavior:
Build UTBotJava using a Java 17 JDK. In my case, running on MacOS, I used:
If I manually remove ~/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jdk7, then rerun the mvn command described above using a Java 8 JDK, I can see exactly which kotlin-stdlib-jdk7 dependency is being downloaded:
...
[INFO] --- utbot:2023.10-SNAPSHOT:generateTestsAndSarifReport (default-cli) @ soapbox-race ---
Downloading from central: https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.6.21/kotlin-stdlib-jdk7-1.6.21.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.6.21/kotlin-stdlib-jdk7-1.6.21.pom (1.4 kB at 3.8 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.8.0/kotlin-stdlib-jdk7-1.8.0.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.8.0/kotlin-stdlib-jdk7-1.8.0.pom (1.4 kB at 92 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.7.0/kotlin-stdlib-jdk7-1.7.0.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.7.0/kotlin-stdlib-jdk7-1.7.0.pom (1.4 kB at 99 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.7.20/kotlin-stdlib-jdk7-1.7.20.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.7.20/kotlin-stdlib-jdk7-1.7.20.pom (1.4 kB at 154 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.8.0/kotlin-stdlib-jdk7-1.8.0.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.8.0/kotlin-stdlib-jdk7-1.8.0.jar (963 B at 107 kB/s)
[ERROR] Unexpected error while generating SARIF report
java.lang.NoClassDefFoundError: kotlin/jdk7/AutoCloseableKt
...
Looks like we're getting kotlin-stdlib-jdk7-1.8.0.jar. However, that specific jar does not contain an implementation of kotlin.jdk7.AutoCloseableKt:
Description
I built UTBotJava-2023.10 using Java 17, after finding that both Java 8 and Java 11 resulted in build failures.
I added the UTBotJava Maven plugin to an open-source project's
pom.xml
, then tried to use Maven to run theutbot:generateTestsAndSarifReport
task. The target project is still based on Java 8, so I setJAVA_HOME
to a Java 8 JDK when running Maven. Theutbot:generateTestsAndSarifReport
task failed, reportingjava.lang.ClassNotFoundException: kotlin.jdk7.AutoCloseableKt
. Using a Java 17 JDK when running Maven fails even earlier, as the target application does not compile under Java 17.To Reproduce
Steps to reproduce the behavior:
Build UTBotJava using a Java 17 JDK. In my case, running on MacOS, I used:
Check out nilzao/soapbox-race@5acac4da. Other revisions might exhibit the same problem, but that's the specific revision I used.
Modify
soapbox-race
'spom.xml
by adding the following lines to the<plugins>
section:Using a Java 8 JDK, run Maven with the
utbot:generateTestsAndSarifReport
target:Also try using the same Java 17 JDK that was used to compile UTBotJava:
Expected behavior
Tests and a SARIF report should be generated.
Actual behavior
When running Maven using Java 8, failure due to
java.lang.ClassNotFoundException: kotlin.jdk7.AutoCloseableKt
.When running Maven using Java 17, failure to compile the target application.
Visual proofs (screenshots, logs, images)
Environment
The text was updated successfully, but these errors were encountered: