[FIXED] AppletLoader should support specifying min JRE version

Started by kappa, January 31, 2011, 14:31:48

Previous topic - Next topic

kappa

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).

arielsan

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:
<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.


kappa

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?


arielsan

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.

kappa

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 :)

jediTofu

al_minimum_java_runtime_environment_version_that_is_needed_to_tell_the_user_to_upgrade
cool story, bro

Mickelukas

Quote from: jediTofu on May 04, 2011, 00:40:55
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


jediTofu

Quote from: Mickelukas on May 04, 2011, 13:30:12
Quote from: jediTofu on May 04, 2011, 00:40:55
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

kappa

al_min_jre parameter has now been added to the nightly builds and should be in LWJGL 2.8.

Mickelukas

Sounds great, what will happen if they lack the necessary version?

Any idea about when 1.8 is out?

Mike

kappa

Quote from: Mickelukas on August 29, 2011, 12:39:44
Sounds great, what will happen if they lack the necessary version?
end users will get the following message (instead of a crash):

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

Quote from: Mickelukas on August 29, 2011, 12:39:44
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.

Mickelukas