Hello Guest

[FIXED] AppletLoader should support specifying min JRE version

  • 13 Replies
  • 18787 Views
*

Offline kappa

  • *****
  • 1319
One really annoying aspect of the java plugin is if you run code compiled by a newer version of java on an older version (e.g. 1.6 code on 1.5 vm) it crashes with an exception.

Plugin's like Flash handle this very nicely by automatically checking the version and telling the user to upgrade. This is something Oracle/Sun should have fixed years ago. However it hasn't been and doesn't look like it will be fixed any time soon (not in java 7 and unlikely in java 8 which will appear soon after) and even if there was a fix today it'll still continue effecting ppl for years to come.

The good news is we can fix this on the LWJGL side in the AppletLoader as it is a standalone component from the rest of LWJGL and can easily be compiled to down to 1.4 (or even lower if needed). It can then check the java version on startup (before loading the rest of LWJGL or applet files) and display a nice user friendly 'please update your java' screen to users (maybe even a link to java.com).

Further developers could also specify the minimum version of java needed by their applet through a parameter to the AppletLoader (e.g. Ardor3D requires a minimum java version of 1.6, while LWJGL can work on 1.5).
« Last Edit: January 31, 2011, 15:19:24 by kappa »

Re: [RFE] AppletLoader should support specifying min JRE version
« Reply #1 on: January 31, 2011, 17:13:26 »
With ruben01 we made an applet verifier to test which version of java someone is running and tell a custom message based on that.

The idea was to put our plugin2 applets on gamejolt by using the jnlp_href parameter, but show a nice message when user has no plugin2 enabled.

For example, the applet tag was configured:
Code: [Select]
<applet code="com.gemserk.games.appletverifier.AppletVerifier"
        archive="appletverifier-0.0.1-SNAPSHOT.jar"
        width="800" height="600">
        <param name="jnlp_href" value="http://www.gemserk.com/..../somegame.jnlp">
</applet>

Then, if you have plugin2 enabled the jnlp is automatically downloaded, else the AppletVerifier applet is loaded, checks java version and shows a nice message.

I know this is a different situation, but I believe it could be useful so I like to share the code.

Re: [RFE] AppletLoader should support specifying min JRE version
« Reply #2 on: February 14, 2011, 14:27:07 »
This sounds like a terrific RFE :)

Mike

*

Offline kappa

  • *****
  • 1319
Re: [RFE] AppletLoader should support specifying min JRE version
« Reply #3 on: May 02, 2011, 00:59:28 »
ok, I've got the code for this implemented locally, what do you ppl think would be a good name for the parameter value to use this? Kinda hard to pick one.

e.g.

<param="al_min_jvm" value="1.6">
<param="al_min_jre" value="1.6">
<param="al_minimum_jre" value="1.6.0">
<param="al_jvmversion" value="1.6.0_10">
<param="al_jre_version" value="1.5.0">
<param="al_minimum_version" value="1.6.0_20">
<param="al_min_jre_version" value="1.6.0_20">

or something else?

Re: [RFE] AppletLoader should support specifying min JRE version
« Reply #4 on: May 02, 2011, 21:49:39 »
I like al_min_jre_version :)

Mike

Re: [RFE] AppletLoader should support specifying min JRE version
« Reply #5 on: May 03, 2011, 01:54:47 »
IMO _version is redundant, with al_min_jre you already know it is the jre version.

But, for me they are all the same, you could use whichever you want.

*

Offline kappa

  • *****
  • 1319
Re: [RFE] AppletLoader should support specifying min JRE version
« Reply #6 on: May 03, 2011, 13:59:49 »
ok, guess will go for al_min_jre then, will apply patch hopefully on the weekend, until then if you have any objections to al_min_jre speak now or forever hold your silence :)

Re: [RFE] AppletLoader should support specifying min JRE version
« Reply #7 on: May 04, 2011, 00:40:55 »
al_minimum_java_runtime_environment_version_that_is_needed_to_tell_the_user_to_upgrade
cool story, bro

Re: [RFE] AppletLoader should support specifying min JRE version
« Reply #8 on: May 04, 2011, 13:30:12 »
al_minimum_java_runtime_environment_version_that_is_needed_to_tell_the_user_to_upgrade

Oh, I like that one!
al_minimum_java_runtime_environment_version_that_is_needed_to_run_the_applet_or_it_will_bring_the_user_to_the_applet_download_page_so_they_can_get_the_latest_and_greatest_java_runtime_environment_version_so_the_applet_will_work


Re: [RFE] AppletLoader should support specifying min JRE version
« Reply #9 on: May 06, 2011, 05:07:16 »
al_minimum_java_runtime_environment_version_that_is_needed_to_tell_the_user_to_upgrade

Oh, I like that one!
al_minimum_java_runtime_environment_version_that_is_needed_to_run_the_applet_or_it_will_bring_the_user_to_the_applet_download_page_so_they_can_get_the_latest_and_greatest_java_runtime_environment_version_so_the_applet_will_work

Ladies and gentlemen, we have a winner.

I hope to at least see this as an alternative syntax for it.
cool story, bro

*

Offline kappa

  • *****
  • 1319
Re: [RFE] AppletLoader should support specifying min JRE version
« Reply #10 on: August 29, 2011, 01:03:41 »
al_min_jre parameter has now been added to the nightly builds and should be in LWJGL 2.8.

Re: [FIXED] AppletLoader should support specifying min JRE version
« Reply #11 on: August 29, 2011, 12:39:44 »
Sounds great, what will happen if they lack the necessary version?

Any idea about when 1.8 is out?

Mike

*

Offline kappa

  • *****
  • 1319
Re: [FIXED] AppletLoader should support specifying min JRE version
« Reply #12 on: August 29, 2011, 12:58:13 »
Sounds great, what will happen if they lack the necessary version?
end users will get the following message (instead of a crash):

Quote
Your version of Java is out of date.
Visit java.com to get the latest version.
Java <al_min_jre> or greater is required.

Any idea about when 1.8 is out?
Shouldn't be too long now, we've got enough features/fixes in there now to warrant a new release, just currently in process of getting the patch in that fixes applets on mac (requires some rather significant changes) so might need sometime to get tested properly, the new native windows resizing api is there mostly but still has a few bugs that need ironing out. Guessing that it should be released sometime after that.

Re: [FIXED] AppletLoader should support specifying min JRE version
« Reply #13 on: August 29, 2011, 13:07:27 »
Sounds great, this will be a really nice version :)