-
Notifications
You must be signed in to change notification settings - Fork 58
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
Unsupported class file major version Error? #356
Comments
Hi. From the exception:
and:
it seems that PIT might don't support the latest JDK version. The good point is that @hcoles has just bumped the shaded ASM version and it should be available in the next PIT version. |
The recent bump of ASM is for Java 22 support. 21 should already work with the released version (although I don't think the test matrix was updated). I think the issue in this case might be that an older version of PIT is configured. |
You are completely right Henry:
which uses quite old PIT version. @JimLynchCodes please switch to 1.15.0 which uses PIT 1.15.0 by default (and could be also overridden) |
@JimLynchCodes The class Btw, |
You have targetClasses set to 'LP*' and nothing set for targetTests. Unless the gradle plugin does something different than pitest, this means your targetTests are also implicitly set to 'LP*'. Your code is in the package 'LP' (although the source file is in src/main/java rather than scr/main/java/LP) so is picked up by the filter. The test is in the default package, so will not be picked up. To fix move your test into the LP package. I'd also recomend moving the production source file into the standard location. There are still a lot of other issues though. The tests aren't actually testing the code in the LP pacakge, they're testing another class of the same name that's in the src/test tree. Also, the tests fail. |
I sort of "inherited" this project so I would rather not change the directory structure or packages here. However, I was able to get it working as is by just putting "Lasagna" and "LasagnaTest" as the values for TargetClasses and TargetTests, respectively:
And I changed the plugin to version '1.15.0'. It seems to be working, and I can view all the mutations in the nice html report. So beautiful. 🥹 ☕️ |
Hi, I'm trying to get pitest running in this java gradle project but having a VERY difficult time... 😢
I have at least two problems: one about packages and one about Java versions.
The first issue is that my project is set up with a public class not contained within any package. I know it is kind of an antipattern to do this, but for a project with only a single java class and test file it seems unnecessary to have an additional package container.
Anyway, it seems like pitest cannot file the file without it being inside of a package. Any I wrong here? Is there something I can put for the "testClasses" value that it would pick up my Lasagna class?
Ok, so in the code here I have declared the "LP" package for my Lasagna class and updated my
build.gradle
with this pitest block:The problem though is when I run
gradle pitest
I get an "Unsupported class version" Error...When I run
gradle -v
I get this output:When I run
java -v
it outputs an error, but I do havejabba
installed and can switch versions if I need to, but I am unsure if it even wants me to switch the version my current shell is using or which version to switch it to...The text was updated successfully, but these errors were encountered: