0

I'm trying to use the @Test annotation in my Spring Boot application to create a test method in my StudentsService class. However, when I use this annotation, I get errors in the packages "jakarta" that were working perfectly lately.

So, I tried switching to the javax package, no errors, but when I hit the run the application failed to start and showed the following error: "nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet", "nested exception is java.lang.IllegalArgumentException: Unsupported class file major version 63".

I'm not sure what is causing this error and how to fix it. Can someone please help me resolve this issue?

I tried switching manually from Jakarta to javax packages in my Spring project and used the @Test annotation for a new method called countStudent(). I expected that the code would work as it did before, but it threw errors in the Jakarta packages when I used the @Test annotation. Then, I switched to the javax packages and it failed to start with the error message

Novice
  • 1
  • Generally this is due to crappy depenency management. If you are using Spring Boot 3 you need to use the Jakarta packages if you are using earlier versions you need to use the Javax packages. – M. Deinum Apr 05 '23 at 13:37
  • Does this answer your question? [Spring initializr project results in Unsupported class file major version 64](https://stackoverflow.com/questions/75878942/spring-initializr-project-results-in-unsupported-class-file-major-version-64) – zawarudo Apr 05 '23 at 14:19

0 Answers0