2

I'm developing with CodenameOne in the IntelliJ IDE. When I choose "Send MacOS Desktop Build", I get this error message:

Unsupported major.minor version 51.0

My project SDK says 1.5 (Java Version 1.6.0_65) My Language level is set to 5.0

I've done a rebuild, which should recompile everything, but I still get this error. Version 51 refers to Java 7. Can anyone tell me how to fix this?

MiguelMunoz
  • 4,548
  • 3
  • 34
  • 51

4 Answers4

2

Does your project have any 3rd party cn1libs? It is possible some of them have been compiled with Java 7.

A workaround in that case would be to change your project to use Java 8. (I think that is supported in IntelliJ, but not 100% sure). For changing the project to Java 8 there are a few settings you need to change. It is usually just easier to start a new project and check "Java 8" in the wizard. Then copy your sources over.

steve hannah
  • 4,586
  • 11
  • 18
  • Thank you for the suggestion. I haven't added any libraries to the project. It's just a standard project. But the CLDC11.jar file shows version 51.0. That must be the problem. So I guess now the question becomes this: Where do I get a CLDC11.jar file that wasn't compiled with Java 7? – MiguelMunoz Dec 03 '15 at 01:18
2

Please find the list of major minor version related issue.

J2SE 8 = 52,
J2SE 7 = 51,
J2SE 6.0 = 50,
J2SE 5.0 = 49,
JDK 1.4 = 48,
JDK 1.3 = 47,
JDK 1.2 = 46,
JDK 1.1 = 45

We can change the required compatible JDK Version from Configuration Page and it should work out.

dildeepak
  • 1,349
  • 2
  • 16
  • 34
1

This is a problem because we require a minimum of JDK 1.7 and now recommend JDK 8. You need to set IntelliJ to use that JDK and configure it to use it.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • The local build works fine. I can build and run in the simulator without any problem. It's only when I go to the Codename One menu and choose one of the "Send Xxx Build" menu items that I get this error. (But thanks for fixing the 51 class version bug.) – MiguelMunoz Dec 03 '15 at 07:12
  • I understood. I was referring to the xcode error log, scroll to the bottom of that and follow my instructions or provide the full log file/link. – Shai Almog Dec 03 '15 at 07:14
  • I see. I have no idea where to find the xcode error log. – MiguelMunoz Dec 03 '15 at 08:08
  • Its the file where you took the messages you listed above. In that same file scroll all the way down... – Shai Almog Dec 03 '15 at 10:35
  • Thanks. The problem seems to be in this line: That jar file has a class version of 51.0. – MiguelMunoz Dec 03 '15 at 17:40
  • Seems I completely misread the question (wires crossed with a separate issue sorry...) the minimum JDK version we require is 1.7 so you need to configure intellij to run on that or Java 8. – Shai Almog Dec 03 '15 at 17:51
  • Thanks. That was the problem. It's now working fine. – MiguelMunoz Dec 04 '15 at 08:34
0

I had this issue while running cxf soap client.

Server: apache-tomcat-7.0.33

Error: java.lang.UnsupportedClassVersionError: org/apache/cxf/jaxws/JaxWsProxyFactoryBean : Unsupported major.minor version 51.0

Resolution: Resolved this by compiling the app using jdk1.8.0_65. Earlier i was using jdk1.7.

Nandan
  • 497
  • 2
  • 7
  • 18