I'm working on a java module using maven to build, all of my code builds successfully on main/java
, but when I try to start creating the tests and I instantiate a class from the test/java
folder the build fails with the following error:
java.lang.UnsupportedClassVersionError: javax/servlet/jsp/tagext/TryCatchFinally : Unsupported major.minor version 51.0
I'm using intelliJ in a mac, and when I check my (only) java version installed I get this:
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
Same for javac.
I've tried the following:
- Invalidate Cache and restart IntelliJ
- Check the java compiler settings on IntelliJ (everything is set to 1.6)
- Delete the javax folder on my .m2 directory so maven downloads it again
- Double checked the versions on my pom
I can't build with java 7 because then it will break a huge deal of code because Im working on a module that will interact with a java 6 built project.
It makes no sense to me because this happens only when the code is in a jUnit test case, otherwise it works!
Your help is very appreciated, thanks.
EDIT: This is not a duplicate question... because none of the existing questions talks about the version of the TryCatchFinally version. Some people are just trying to earn badges or something...