Thursday, October 8, 2015

org/apache/commons/dbcp2/BasicDataSource : Unsupported major.minor version 51.0


org/apache/commons/dbcp2/BasicDataSource : Unsupported major.minor version 51.0

Problem :


I came across this common exception when i was setting up datasource for spring application.

Exception I Encountered Was :


###################################################################################################################

org/apache/commons/dbcp2/BasicDataSource : Unsupported major.minor version 51.0

###################################################################################################################

Solution :


When I was setting up the datasource for Spring Application and had to use BasicDataSource jar file. The jar which i was using was not compatible with the java / jvm version i was using.


run mvn dependency:tree then you will know the exact jar which is compatible with the java version you have to use then change the version in dependency and again run the maven command to resolve the exception. Hope this helps resolve your exception, Happy Coding.

Similar Exception :


- org/apache/commons/dbcp2/BasicDataSource : Unsupported major.minor version 51.0
- UnsupportedClassVersionError unsupported major.minor version 51.0
- unsupported major.minor version 51.0 unable to load class