Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2007

Tip: Looking for answers? Try searching our database.

[applet] handle wrong jre

Thread view: 
oliv@linuxmail.org - 10 Oct 2007 17:55 GMT
Hi,
I have an applet written with java5.
Suppose someone tries to execute it with a jre4.
java console will print a system exception.
But how can I handle that exception properly and show a user friendly
dialog box telling that a jre update is needed ?
thanks !
Andrew Thompson - 10 Oct 2007 18:14 GMT
..
>I have an applet ..

You like trouble?

>..written with java5.
>Suppose someone tries to execute it with a jre4.

As they might.  End users are mean that way.

>java console will print a system exception.
>But how can I handle that exception properly and show a user friendly
>dialog box telling that a jre update is needed ?

One (almost) solution
<http://www.physci.org/codes/jre.html>

A far better solution.  Use JWS To launch the applet..
<http://www.physci.org/jws/#jtest>
..and for versioning..
<http://www.physci.org/jws/version.html>

>thanks !

No worries.

Signature

Andrew Thompson
http://www.athompson.info/andrew/

Roedy Green - 11 Oct 2007 07:29 GMT
>One (almost) solution
><http://www.physci.org/codes/jre.html>

1. could you add 1.6?

2. the docs should probably say [requires 1.3+] etc.

3. it would be clearer if instead of [v1.2] you said  [value="1.2"]

4. it is not clear what you are doing with all those vxx links.
Perhaps a real-life example of use would be best, with the <param
shown without having to peek at the source.

Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Andrew Thompson - 12 Oct 2007 04:10 GMT
On Oct 11, 4:29 pm, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:

> >One (almost) solution
> ><http://www.physci.org/codes/jre.html>
>
> 1. could you add 1.6?

hmm..  I only resurrected the JRE page at the specific
request of a user.  I am not convinced it is a good
method to use, given the vagaries of showDocument().

But.. if you wanted to update it for 1.6, you might
change ..

..
 Class.forName("java.lang.Appendable");
 javaVersionNumber++;
..

..for this..

..
 Class.forName("java.lang.Appendable");
 javaVersionNumber++;
 Class.forName("java.awt.Desktop");
 javaVersionNumber++;
..

It would be nice to keep the classes as all
java.lang.??, but as far as I dould determine,
there were no new *classes* in lang for 1.6.

> 2. the docs should probably say [requires 1.3+] etc.

It is compiled for Java 1.1.  I thought that would be
'inuitively obvious', but your comment makes me realise
my mistake*.

> 3. it would be clearer if instead of [v1.2] you said  [value="1.2"]

Good point*.

> 4. it is not clear what you are doing with all those vxx links.
> Perhaps a real-life example of use would be best, with the <param
> shown without having to peek at the source.

Not sure I understand what you mean, but the unfortunate
thing for most developers is that having a recent VM means
it is very hard to see it 'redirect' - unless I include
arbitrary values (version='9.3').

* Things I would change, assuming I ever revisit that
page.  But personally, I think JWS provides better
versioning options, and applets are (largely) passe,
in any case..

Andrew T.
Roedy Green - 12 Oct 2007 07:11 GMT
On Fri, 12 Oct 2007 03:10:16 -0000, Andrew Thompson
<andrewthommo@gmail.com> wrote, quoted or indirectly quoted someone
who said :

>Not sure I understand what you mean, but the unfortunate
>thing for most developers is that having a recent VM means
>it is very hard to see it 'redirect' - unless I include
>arbitrary values (version='9.3').

You need a paragraph something like:

"Below are invocations of the Version Check Applet that will redirect
you if your browser is not sufficiently recent.  If you have  the
latest browser, clicking the link won't do anything."

I don't understand what those links do.  I know it is obvious to you,
but not to me.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Roedy Green - 11 Oct 2007 07:21 GMT
>I have an applet written with java5.
>Suppose someone tries to execute it with a jre4.
>java console will print a system exception.
>But how can I handle that exception properly and show a user friendly
>dialog box telling that a jre update is needed ?
>thanks !

I handle it with some generated boilerplate that says which version of
Java is required.  See
http://mindprod.com/jgloss/applet/holidaycalculator.html

I also have a method that checks the Java version. However, in many
cases the code won't even start without a proper match.
See http://mindprod.com/products1.html#COMMON11
Look for com.mindprod.common11.VersionCheck

On my todo list is to write some JavaScript boiler plate to test the
Java version and display a message instead of the Applet if it is bad
or there is no Java at all.

Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.