Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » java.lang.UnsupportedClassVersionError: Bad version number in .class file
java.lang.UnsupportedClassVersionError: Bad version number in .class file [message #326426] Wed, 19 March 2008 13:48 Go to next message
Mikael Petterson is currently offline Mikael PettersonFriend
Messages: 158
Registered: July 2009
Senior Member
Hi,

We have built and tested our plugin using jdk 1.5_10. Then when we try to
run the plugin in the eclipse environment we get:

java.lang.UnsupportedClassVersionError: Bad version number in .class file

I guess it is beacause the plugin is running in an older version of java.

How do I make sure that the plugin runs on the same version as it was
compiled with ? Is it possible to add a check for that when you install
the plugin?

cheers,

//mike
Re: java.lang.UnsupportedClassVersionError: Bad version number in .class file [message #326428 is a reply to message #326426] Wed, 19 March 2008 14:04 Go to previous messageGo to next message
Arun Sudhir is currently offline Arun SudhirFriend
Messages: 16
Registered: July 2009
Junior Member
When the JVM's classloader itself tries to load a class, it doesn't have any
forward compatibility. It cannot recognize classes built with a newer
version of Java. So the only go I guess is to build your plugin with the
lowest version possible OR make sure everyone has JRE 1.5 or higher
installed.

The stacktrace thrown here is enough indicator that the JVM is too old for
the plug-in. If you still require some sort of "pretty message" to come up
other than the stack trace, then the only hack I can think of is to use
another mini plugin attached to your actual plug-in -a class built on say
1.4, which actually checks the version of JRE that Eclipse is using right
now and sees whether its enough for your plug-in. Hope this helps!

Arun


"Mikael Petterson" <mikaelpetterson@hotmail.com> wrote in message
news:89e504a3f53a00393a2a61577d5cb749$1@www.eclipse.org...
> Hi,
>
> We have built and tested our plugin using jdk 1.5_10. Then when we try to
> run the plugin in the eclipse environment we get:
>
> java.lang.UnsupportedClassVersionError: Bad version number in .class file
>
> I guess it is beacause the plugin is running in an older version of java.
>
> How do I make sure that the plugin runs on the same version as it was
> compiled with ? Is it possible to add a check for that when you install
> the plugin?
>
> cheers,
>
> //mike
>
Re: java.lang.UnsupportedClassVersionError: Bad version number in .class file [message #326432 is a reply to message #326428] Wed, 19 March 2008 16:08 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Hi,

Actually you can put in your plugin.xml (Manifest.mf?) a marker to
indicate that your plugin requires 1.5 at least and that the plugin will
be disabled until Eclipse comes up with 1.5 as its JVM.

Bring up the Plugin editor on the Manifest.MF of your plugin and go to
the Overview page. In the lower left corner there is a box that says
Execution Environments. From there hit the Add... button and select
J2SE-1.5.


--
Thanks,
Rich Kulp
Previous Topic:Dynamic Help
Next Topic:New newsgroup for PDE
Goto Forum:
  


Current Time: Fri Sep 27 15:29:26 GMT 2024

Powered by FUDForum. Page generated in 0.03685 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top