Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning major version 52 is newer than 51, the highest major version supported by this compiler

Basicly I'm super newbie and started internship in IT company. I installed VS with Xamarin. The problem that I'm facing is very frustrating. So even when i create empty project I can't compile it and get error like this :

Severity Code Description Project File Line Suppression State Warning major version 52 is newer than 51, the highest major version supported by this compiler.

I searched all over google and asked so many people and still no fix of my problem. If anybody can help me via skype or teamwiever i will APPRECIATE so much. My skype: toniterdal , feel free to add me.

like image 238
T.Gelev Avatar asked Jul 06 '16 11:07

T.Gelev


3 Answers

I was having the same issue, and tearing my hair out. I had the JDK Version 8 installed, but these warnings wouldn't go away, and eventually they generated a build-breaking error.

When I went to Tools -> Options -> Xamarin, and looked at the Android Settings, the Java Development Kit Location was pointing to jdk.1.7.xxxx, in Program Files (x86).

I changed it to 1.8.0_101, in Program Files. Then I restarted Visual Studio, and the same error happened again. Somehow, Visual Studio was detecting Version 7 of the JDK and pointing it to that automatically.

So the solution turned out to be very simple. As well as installing Version 8 of the JDK, UNINSTALL Version 7 of the JDK. As soon as I did that, Xamarin turned out to be much better behaved. This step solved a whole bunch of seemingly unrelated problems.

enter image description here

like image 183
Rob Lyndon Avatar answered Sep 23 '22 22:09

Rob Lyndon


That error is telling you that the Java Class version that is being loaded was compiled with Java 8 (52) but Java 7 (51) is trying to load that compiled class.

  • Java 7 uses major version 51

  • Java 8 uses major version 52

Check which Java version(s) are installed on your machine and review Xamarin's requirements and Java installation steps (linked below)

Installing the Java SDK (JDK)

like image 34
SushiHangover Avatar answered Sep 23 '22 22:09

SushiHangover


For people having problems with setting the appropriate JDK version, you might want to try to override this setting in the vs2015 options dialog:

Cross Platform Dialog

like image 10
Stefan Avatar answered Sep 20 '22 22:09

Stefan