MovieAdmin sample application can not run with java.lang.UnsupportedClassVersionError: Bad version number in .class file in server log file.

The problem could happen if there is a mismatch on JDK versions for IDE and application server, e.g. use jdk1.6.0_XX to run IDE and use jdk1.5.0_XX to run Glassfish server.

To solve the problem, you can either use same version of JDK for both IDE and application server or do the following:

a. Go to Tools > Java Platforms and add a jdk1.5.0_XX platform.

b. Right-click the MovieAdmin project node and select Properties from the contextual menu.

c. Go to the Libraries node and change the Java Platform dropdown to the JDK 1.5 platform.

d. Repeat for the Movie Class Library project.

e. Build and deploy.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo