Problem with Applet Under Mac Leopard

Discussion in 'Java' started by Roedy Green, Jun 16, 2009.

  1. Roedy Green

    Roedy Green Guest

    A naive user has written me saying an Applet is "broken" under Mac OS
    Leopard with Java 1.6.

    The applet is at http://mindprod.com/applet/canadiantax.html

    I wonder if someone with Leopard could give it a poke and give me a
    better clue of just how it is failing.

    All it does is compute Canadian sales taxes for the various provinces.

    There is an equivalent one for the USA at
    http://mindprod.com/applet/americantax.html

    Also could anyone with a Leopard tell me what you do to turn on the
    Java error console. I would like to add that to the entry at
    http://mindprod.com/jgloss/console.html
    on how to turn on the console in various platforms.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com

    If everyone lived the way people do in Vancouver, we would need three more entire planets to support us.
    ~ Guy Dauncey
     
    Roedy Green, Jun 16, 2009
    #1
    1. Advertising

  2. Roedy Green

    Roedy Green Guest

    On Tue, 16 Jun 2009 16:37:30 -0700, "Peter Duniho"
    <> wrote, quoted or indirectly quoted
    someone who said :

    >
    >Can't tell for sure, but looks like you might have an infinite loop
    >somewhere.
    >
    >When I try to load it in the browser normally, the applet is empty, with
    >the little "X" doc icon in the upper left. On Safari, if I switch tabs
    >and come back a minute or so later, the "X" eventually disappears. On
    >Opera, it seems to remain. In neither case does it get far enough to draw
    >anything.


    What does is the os.name property for Leopard? See
    http://mindprod.com/applet/wassup.html

    I have added some progress messages that might help track down where
    it is getting stuck. Could you please give it another poke.

    You should see:
    selecting fonts...
    setting L&F...
    creating components...
    calculating default values...







    --
    Roedy Green Canadian Mind Products
    http://mindprod.com

    If everyone lived the way people do in Vancouver, we would need three more entire planets to support us.
    ~ Guy Dauncey
     
    Roedy Green, Jun 17, 2009
    #2
    1. Advertising

  3. In article <>,
    Roedy Green <> wrote:

    > A naive user has written me saying an Applet is "broken" under Mac OS
    > Leopard with Java 1.6.
    >
    > The applet is at http://mindprod.com/applet/canadiantax.html
    >
    > I wonder if someone with Leopard could give it a poke and give me a
    > better clue of just how it is failing.
    >
    > All it does is compute Canadian sales taxes for the various provinces.


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

    Compiles and runs under 1.5 fine, though. Java version "1.5.0_19" is the
    current default. There's a 1.6 applet plugin, but it's 64-bit only.

    > There is an equivalent one for the USA at
    > http://mindprod.com/applet/americantax.html


    Same error; not compiled.

    > Also could anyone with a Leopard tell me what you do to turn on the
    > Java error console. I would like to add that to the entry at
    > http://mindprod.com/jgloss/console.html
    > on how to turn on the console in various platforms.


    Applications > Utilities > Java > Preferences.app > Advanced > Show
    console.

    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
     
    John B. Matthews, Jun 17, 2009
    #3
  4. In article <>,
    "John B. Matthews" <> wrote:

    > > Also could anyone with a Leopard tell me what you do to turn on the
    > > Java error console. I would like to add that to the entry at
    > > http://mindprod.com/jgloss/console.html
    > > on how to turn on the console in various platforms.

    >
    > Applications > Utilities > Java > Preferences.app > Advanced > Show
    > console.


    Oops, that should be

    Applications > Utilities > Java Preferences.app > Advanced > Show
    console.


    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
     
    John B. Matthews, Jun 17, 2009
    #4
  5. Roedy Green

    Roedy Green Guest

    On Tue, 16 Jun 2009 21:06:27 -0400, "John B. Matthews"
    <> wrote, quoted or indirectly quoted someone who
    said :

    >java.lang.UnsupportedClassVersionError: Bad version number in .class file
    >
    >Compiles and runs under 1.5 fine, though. Java version "1.5.0_19" is the
    >current default. There's a 1.6 applet plugin, but it's 64-bit only.


    I ran the entire body of utilities through Jarcheck and was astounded
    to find all kinds of that sort of error. I have tracked down the
    causality chains and repaired everything. Reposting is in progress.

    It is so weird the way things can be causal in computers that don't on
    the surface have anything to do with each other than they were
    recently changed. Perhaps that is why humans so easily presume
    causality when things occur together.

    Does the Mac OSX 1.6 need a 64-bit OS to run? If not, should it not
    have been happy with the 1.6 class versions?
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com

    If everyone lived the way people do in Vancouver, we would need three more entire planets to support us.
    ~ Guy Dauncey
     
    Roedy Green, Jun 17, 2009
    #5
  6. In article <op.uvnxccih8jd0ej@clampitt>,
    "Peter Duniho" <> wrote:

    > On Wed, 17 Jun 2009 00:39:52 -0700, Roedy Green
    > <> wrote:
    >
    > > [...]
    > > Does the Mac OSX 1.6 need a 64-bit OS to run? If not, should it
    > > not have been happy with the 1.6 class versions?

    >
    > Yes. Java 1.6 on the Mac is 64-bit only. :( It can't even be
    > installed on OS versions earlier than Leopard. Grrr...
    >
    > I still don't know why that should matter. Yes, 1.5 is the default
    > host for an applet, but it seems to me if you've published your
    > applet requiring 1.6, the OS should be smart enough to use the
    > 64-bit, 1.6 run-time. Maybe it can't handle a 64-bit Java run-time
    > in the web browsers? On Windows, the 64-bit OS can run 32-bit apps,
    > but those apps can't load 64-bit code. Maybe Leopard has a similar
    > issue. If Opera is 32-bit code, that might explain that. But I'd
    > think Apple would've provided a 64-bit Safari, and your applet is
    > broken there too. (In fact, I just checked, and Apple's web site
    > says Safari is a 64-bit app).


    Indeed, I can compile and run Java applications and applets with 1.6.
    Applets run fine in Applet Launcher, appletviewer and my editor's HTML
    previewer; but Safari insists "Bad version number in .class file."

    > Oh well, there's a lot about Java on the Mac that seems weird and/or
    > user-unfriendly to me. So there you go. :)


    What Apple calls "Java for Mac OS X 10.5 Update 4" fixes a number of
    lingering security problems:

    <http://support.apple.com/kb/HT3632>

    Several gotchas: 1) Java Preferences no longer changes versions, but
    relinking still works:

    $ cd /System/Library/Frameworks/JavaVM.framework/Versions
    $ sudo ln -fhsv 1.6 CurrentJDK

    2) The aliases in /Developer/Applications/Utilities for Applet Launcher
    and Jar Bundler are removed, the originals are still available in
    /usr/share/java/Tools.

    3) Several commands in NetBeans break; most seem related to creating new
    files or projects:

    <http://statistics.netbeans.org/analytics/detail.do?id=150231>

    > Sounds like you've got a solution, thanks to John's info. Sorry I
    > wasn't able to produce more useful information myself (not sure what
    > the whole "freezing up" thing was all about).


    Both applets are running fine, now:

    <http://mindprod.com/applet/americantax.html>
    <http://mindprod.com/applet/canadiantax.html>

    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
     
    John B. Matthews, Jun 17, 2009
    #6
  7. Roedy Green

    vkj Guest

    Hello,

    > Several gotchas: 1) Java Preferences no longer changes versions, but
    > relinking still works:
    >
    > $ cd /System/Library/Frameworks/JavaVM.framework/Versions
    > $ sudo ln -fhsv 1.6 CurrentJDK


    <<SNIP>>

    > Both applets are running fine, now:
    >
    > <http://mindprod.com/applet/americantax.html>
    > <http://mindprod.com/applet/canadiantax.html>


    I tried the step 1 mentioned above, however Safari/Firefox still
    defaults to using version 1.5. Can you confirm that by creating the
    softlinks as mentioned here, you were able to get the applet displayed
    on the browser?

    Thanks
    vkj
     
    vkj, Jun 18, 2009
    #7
  8. In article
    <>,
    vkj <> wrote:

    > > Indeed, I can compile and run Java applications and applets with
    > > 1.6. Applets run fine in Applet Launcher, appletviewer and my
    > > editor's HTML previewer; but Safari insists "Bad version number in
    > > .class file."

    [...]
    > > Several gotchas: 1) Java Preferences no longer changes versions,
    > > but relinking still works:
    > >
    > > $ cd /System/Library/Frameworks/JavaVM.framework/Versions
    > > $ sudo ln -fhsv 1.6 CurrentJDK

    [...]
    > I tried the step 1 mentioned above, however Safari/Firefox still
    > defaults to using version 1.5. Can you confirm that by creating the
    > softlinks as mentioned here, you were able to get the applet
    > displayed on the browser?


    Quite the opposite, as I tried to indicate in my original response,
    restored above. In particular, after relinking, I can compile and run
    applets with Java version 1.6. Such applets run fine in Applet
    Launcher, appletviewer and my editor's HTML previewer; but they fail to
    load in Safari 4.

    I don't know if Safari 4 ignores the applet plugin settings in Java
    Preferences, or if it is simply unable to use the 1.6 plugin.

    By way of correction, I had set JAVA_HOME in ~/.bash_profile: export
    JAVA_HOME=/Library/Java/Home. Omitting this export restores normal
    operation of Java Preferences for the command line, obviating the need
    for relinking.

    Gotchas 2 & 3 remain unresolved.

    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
     
    John B. Matthews, Jun 19, 2009
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. chewie54
    Replies:
    5
    Views:
    381
    =?UTF-8?B?QXJuZSBWYWpow7hq?=
    Oct 30, 2007
  2. chewie54
    Replies:
    1
    Views:
    283
    Horace Enea
    Oct 20, 2007
  3. chewie54
    Replies:
    0
    Views:
    273
    chewie54
    Oct 29, 2007
  4. geert
    Replies:
    8
    Views:
    399
    Graham Dumpleton
    Mar 19, 2008
  5. Maximiliano Caceres

    Problem: Installing Curb in Mac OS Leopard

    Maximiliano Caceres, Sep 13, 2009, in forum: Ruby
    Replies:
    1
    Views:
    125
    Michael Linfield
    Sep 14, 2009
Loading...

Share This Page