Unsupportedclassversionerror Inwards Upgrading From Jdk6 To 7

Currently I'm working on a JavaEE6 projection that is beingness deployed inward Glassfish when I decided to upgrade my Java version (to endeavor the novel features), in addition to then I encountered this issue. Note that I'm running on Ubuntu 12.04

There are several things to expect at to solve this issue:

1.) Make certain that you lot install the coffee vii version (I'm using the i from openjdk).
>sudo apt-get install openjdk-7-jdk 

2.) Update the default coffee in addition to javac version your auto is using. Make certain to conduct the version 7.
>sudo update-alternatives --config javac >sudo update-alternatives --config coffee 

3.) If you're working on eclipse, laid your project's compiler version to 1.7. Right click the project->properties->Java Compiler. Or you lot tin laid inward in workspace in addition to disable projection specific settings of eclipse.

4.) Again on eclipse, add together coffee 7. By clicking Windows->Preferences->Java->Installed JREs in addition to betoken to where you lot install openjdk, unremarkably inward /usr/lib/jvm/openjdk*.

5.) More on eclipse, matched the execution environment. By opening Windows->Preferences->Java->Installed JREs->Execution Environment. Select JavaSE-1.7 in addition to on the correct panel Compatible JREs, conduct java-7-openjdk*.

6.) And in conclusion brand certain that your Glassfish runtime which you lot fix previously (I assume is nevertheless using coffee 1.6) is updated in addition to is pointing to 1.7. Windows->Preferences->Server->Runtime Environments->Select the Glassfish server you lot are using->Click edit->change the JRE to 1.7.
Next
Previous
Click here for Comments

0 komentar:

Please comment if there are any that need to be asked.