Unsupported major.minor version 51.0 - codenameone

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?

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.

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.

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.

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.

Related

Netbeans IDE 13 won't create a new project on Mac

I am running java 8 on my Mac, but when I try to create a new project it gives me this error saying it cannot enable Maven. I never had this problem on windows.
The Apache NetBeans 13 binary releases require JDK 11+, and officially
support running on JDK 11 and JDK 17.
Source: https://netbeans.apache.org/download/nb13/nb13.html
Therefore try to upgrade your JDK.

Codename one version 1.0 is installed even though I install version 6.0 from Eclipse Marketplace

I am using Eclipse 2020-06 (I have made a fresh install of Eclipse instead of upgrading it from an earlier version of Eclipse) and JDK 8 (1.8.0_261). My OS is Windows 10.
JAVA_HOME is set to C:\Program Files\Java\jdk1.8.0_261
When I download "Codename One" plugin from Eclipse Marketplace it shows the version as 6.0 and it says "Installed" at the end of the installation process.
However, when I go to "Help -> Eclipse IDE -> Installation Details" under Eclipse, CodenameOneFeature version is listed as: 1.0.0.201409151325
When I select CodenameOneFeature from this list and hit Update, it says "No updates found". So basically I cannot force it to update to 6.0.
I can confirm that I have the earlier version installed also from the setting of the Codename One projects I create: when I go to Properties -> Java Compiler, the compliance level is set to 1.5 (also 1.5 is used in build.xml file).
BTW, I have also tried installing Eclipse 2019-06 (instead of 2020-06) and/or installing JDK 10 (instead of JDK 8) and/or modifying the eclipse.ini (by adding -vm option) so that it uses the version of JDK I want (instead of setting JAVA_HOME). But no combination of those has solved the problem.
Updated answer:
I found the problem. I broke the update site with a commit a couple of weeks ago. This should be fixed in a couple of hours once server caches refresh.
Original answer:
With Eclipse at this time we only support JDK 8. We're experiencing issues in updating the eclipse plugin to the latest version. Once installed I think you can also use JDK 11 but it doesn't matter since we don't support JDK 11 features.
Once a reasonably new version of the plugin is installed you can press update in Codename One Settings and it will update our libraries to the latest version equivalent to the other IDEs.

gcloud appengine-java install on Fedora 28

I'm having trouble following the instructions here to install the app-engine-java gcloud component on Fedora 28. It appears that it wants JDK 1.7 installed, but Fedora says that JDK 1.8 "obsoletes" 1.7 and won't let me install it next to JDK 1.8. Has anyone else run into this? Is it a bug, or just Fedora being unsupported?
I'm sure there's a binary installer that I could use, but I'd like to use the package if possible.
The workaround that worked for me was
$dnf download google-cloud-sdk-app-engine-java
and
$rpm -ivh <downloaded-rpm> --nodeps

App deployment to cloud fails after upgrading to JDK 7

Since deployment was not allowed with JDK 1.6, I recently moved to JDK 7 and appengine-java-sdk-1.9.4 .
With JDK 7 (JRE 7) everyting works fine on my local development app engine. But when I upload the application to google cloud the deployment fails with below errors.
org/apache/jsp/nodecorate/sample_jsp : Unsupported major.minor version 52.0, java.lang.UnsupportedClassVersionError: org/apache/jsp/test_jsp : Unsupported major.minor version 52.0]
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:656)
do I need to change the application settings to reflect JRE 7 on google could?
The major.minor version 52.0 indicates that your code was compiled under Java 8. GAE production environment runs Java 7.

Unbale to start tomcat 6 after RAM + JVM upgradation

I have upgraded Windows XP - PC RAM from 1GB to 3GB. Since JVM had some problem Eclipse Helios, I had to reinstall it and I did clean installation.
I have installed jdk7( jdk-7-ea-bin-b88-windows-i586-08_apr_2010.exe ).
Now my tomcat( Apache Tomcat Version 6.0.16 ) doesn't start.
Log says
java.lang.UnsupportedClassVersionError:
javax/management/MalformedObjectNameException :
Unsupported major.minor version 51.3
So I installed latest version of Tomcat i.e. Tomcat-6.0.29. Log says
java.lang.ClassFormatError:
Incompatible magic value 1853108037 in class file javax/management/MXBean
Thanks a lot for help.
Yeah it looks like Tomcat isn't compatible with JDK7 This to me says there are bugs

Resources