Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unsupported major.minor version 51.0 (unable to load class org.postgresql.Driver)

Tags:

Created a web app using maven and deployed it on heroku. Everything works find but when I call a action that uses the postgresql-9.2-1002.jdbc4 driver I get:

java.lang.UnsupportedClassVersionError: org/postgresql/Driver : Unsupported major.minor version 51.0 (unable to load class org.postgresql.Driver) 

I know that the problem is I'm using jdk 7 on my development environment and a lower version is running on heroku (at least I think so). My first question is, why does the other actions don't give this error only actions that uses postqresql driver gives this problem the rest of the app works just fine? The other thing I did was download jdk 6 and then added it to my project build path, then configure eclipse compiler compliance to 1.6 but even then I have the same problem. How can I solve this?

like image 874
user2054833 Avatar asked Apr 15 '13 15:04

user2054833


People also ask

How to fix Unsupported major minor version 51. 0?

Refer to this table for a list of the major version of the Java class file. To fix it, download the Java or JDK 7, and change the default JDK from 6 to 7.

What version of Java is 52?

minor version 52.0, the class is compiled using JDK 8 since major version 52 corresponds to Java SE 8.


1 Answers

For java 6 use:

postgresql-9.2-1004-jdbc4.jar  postgresql-9.3-1100-jdbc4.jar  

For java 7 use:

postgresql-9.2-1004-jdbc41.jar  postgresql-9.3-1100-jdbc41.jar  
like image 129
Grigory Kislin Avatar answered Oct 22 '22 01:10

Grigory Kislin