Results 1 to 16 of 16
  1. #1
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default Unsupported major.minor version 51.0

    hello everybody
    I'm developing some applets with java build 1.7.0_03-b05. everything work fine when I start the applets inside eclipse or with the appletviewer. the problem arise when i start the applets with the browsers firefox or internet explorer I got this error:

    java.lang.UnsupportedClassVersionError: HelloSwingApplet : Unsupported major.minor version 51.0

    Ok, I can avoid this error when I set my java environment to 1.6. But my question is, how can I configure my browsers to use java 1.7?

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: Unsupported major.minor version 51.0

    Make sure you have the latest java runtime installed as well as the JDK.

  3. #3
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default Re: Unsupported major.minor version 51.0

    This point is null if you are relying on classes from within 1.7: pass the minor version of the JRE capable of running your app to javac at compile time - very useful to allow users without the latest JRE install (my guess for 1.7 at this time would be many) to run apps compiled on newer JDK versions.

  4. #4
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default Re: Unsupported major.minor version 51.0

    Quote Originally Posted by pbrockway2 View Post
    Make sure you have the latest java runtime installed as well as the JDK.
    on my platform the JRE and JDK is installed properly. The problem is that the browsers use a java plugin with a version for java 6 update 31. Apparently there is no java plugin for java 7, so the only workaround is to compile for java version 6 environment.

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

    Default Re: Unsupported major.minor version 51.0

    Quote Originally Posted by j2me64 View Post
    Apparently there is no java plugin for java 7
    There is, but Java SE 7 is still in the developer preview stage. Java won't automatically update from 6 to 7. A manual download and install will update the browser plugin. Firefox screenshot:

    Unsupported major.minor version 51.0-java7.jpg

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  6. #6
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default Re: Unsupported major.minor version 51.0

    hello db
    I've quite a lot of experience finding stuff with google, but this time I couldn't find the plugins you posted. Could you please help with an url/link?

  7. #7
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

    Default Re: Unsupported major.minor version 51.0

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  8. #8
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default Re: Unsupported major.minor version 51.0

    I couldn't find no plugins for firefox or ie in the url. Sorry, but I need some "Java and Firefox for Dummies" instructions.

  9. #9
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

    Default Re: Unsupported major.minor version 51.0

    All you have to do is download and install the Java 7 JRE. (I installed the JDK, but that shouldn't be needed.) You may need to check the settings in the Java control panel / Advanced -> default Java for Browsers (should be checked by default; if not then check it).

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  10. #10
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default Re: Unsupported major.minor version 51.0

    can you please tell me where a can download the plugins manually? the hint with the advanced checkbox didn't work.

  11. #11
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

    Default Re: Unsupported major.minor version 51.0

    I didn't download any plugin separately. Just the JDK.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  12. #12
    bcbrian is offline Member
    Join Date
    Apr 2012
    Posts
    2
    Rep Power
    0

    Default Re: Unsupported major.minor version 51.0

    Downloading just the JDK will give you the JRE with it, but if you are using JDK 7 and its corresponding JRE, you won't get the error message, but everyone else who tries to view your applets will. There is a class version change (from 50 to 51) between 6 and 7, and 7 is offered automatically to no one; it is for developers to be a step ahead for the next platform. This is only a problem if you want your applets to work for the general public now, because your browser and the java install/version test on Oracle's site will mark 6.31 as the latest. That kind of makes your JDK 7 that works on your computer basically useless for anyone else, so if that's ok with you, great. Otherwise, you will need to switch back until JRE 6 update 31 is not found to be the latest for everyone. I made sure to uninstall all other versions (I also had 64bit versions) before downloading and reinstalling. I also had to recompile my apps to make them work.
    The specific version change and expected conflict is noted in Oracle's documentation linked from the JDK 7 download area.

  13. #13
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default Re: Unsupported major.minor version 51.0

    I full agree with

    Quote Originally Posted by bcbrian View Post
    This is only a problem if you want your applets to work for the general public now, because your browser and the java install/version test on Oracle's site will mark 6.31 as the latest.
    but I can't understand why this problem arise on my system, where the version of jre and jdk is 7.

  14. #14
    bcbrian is offline Member
    Join Date
    Apr 2012
    Posts
    2
    Rep Power
    0

    Default Re: Unsupported major.minor version 51.0

    The reason can have multiple causes. 64bit system? If so, check the 64bit version of Internet Explorer, and see if it works there. That was the only place I had my applets working during this problem. Checking its add-ons, it was using the version 7. Checking the add-ons in my default Internet Explorer (32bit), it was using 6, as were all other browsers on my computer (FF, Opera, I never checked Chrome since I knew by then it wasn't a specific browser's problem). Checking program files proved there were both versions installed on my computer. I was also using JGrasp, and it wasn't easy enough for me to figure out which it was compiling with, but it was obviously v7. Java console for 32 bit JDK does not show up normally after installing 64bit (I also had both) with the Control Panel GUI. Use this command: C:\Program Files (x86)\Java\jre6\bin\javacpl.exe, click the Java tab up top, and then the View button and see if 2 versions are showing up. I never was able to get FF to update to version 7 (it probably would have if I tried it after uninstalling all versions first, but by the time I did that, I was going to v6 and not playing around). Add all of these factors plus the fact that FF blocked v 6 update 30 a few weeks ago, and I think every application's functions just wouldn't play nice together anymore. Even Oracle's site warns against 64bit installs without 32 bit being installed also (and first).
    I can't see your system, but I believe if you look hard enough, you will find that the browsers aren't using version 7 even though you have it installed. Whichever you want to use, it is easiest to just uninstall all java and then go with the JDK you want.

  15. #15
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default Re: Unsupported major.minor version 51.0

    Quote Originally Posted by bcbrian View Post
    The reason can have multiple causes. 64bit system? If so, check the 64bit version of Internet Explorer, and see if it works there.
    Bingo! I removed my firefox 32-bit installation and after installing the 64-bit version I can see that java 1.7.0_03 is recognized inside the browser and also my applets runs without changing any runtime environment or have to install additional plugins. The problem is solved but for further work I've to keep in mind that my applet could make problems on other platforms not having the jre 7 installed.

    Thank you!

  16. #16
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

    Default Re: Unsupported major.minor version 51.0

    I just checked Opera and found that it recognizes both plug-ins. If I disable the Java 7 plug-in, applets run under Java 6. (If both are enabled the higher version is used.)

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Minor AWT drawing issue
    By snaquetime in forum New To Java
    Replies: 6
    Last Post: 06-02-2011, 12:01 AM
  2. Shall we skip Unsupported class version error?
    By makpandian in forum New To Java
    Replies: 1
    Last Post: 04-21-2011, 01:11 PM
  3. Some minor doubts about JAVA
    By naveenpaul1987 in forum New To Java
    Replies: 9
    Last Post: 03-16-2011, 11:53 AM
  4. Minor of a matrix (LinkedListArray)
    By sehudson in forum New To Java
    Replies: 1
    Last Post: 03-08-2011, 07:27 AM
  5. Minor of a matrix
    By sehudson in forum New To Java
    Replies: 3
    Last Post: 02-21-2011, 08:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •