Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Problem with Applet Under Mac Leopard

Reply
Thread Tools

Problem with Applet Under Mac Leopard

 
 
Roedy Green
Guest
Posts: n/a
 
      06-16-2009
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
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      06-17-2009
On Tue, 16 Jun 2009 16:37:30 -0700, "Peter Duniho"
<(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
 
John B. Matthews
Guest
Posts: n/a
 
      06-17-2009
In article <(E-Mail Removed)>,
Roedy Green <(E-Mail Removed)> 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>
 
Reply With Quote
 
John B. Matthews
Guest
Posts: n/a
 
      06-17-2009
In article <(E-Mail Removed)>,
"John B. Matthews" <(E-Mail Removed)> 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>
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      06-17-2009
On Tue, 16 Jun 2009 21:06:27 -0400, "John B. Matthews"
<(E-Mail Removed)> 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
 
Reply With Quote
 
John B. Matthews
Guest
Posts: n/a
 
      06-17-2009
In article <op.uvnxccih8jd0ej@clampitt>,
"Peter Duniho" <(E-Mail Removed)> wrote:

> On Wed, 17 Jun 2009 00:39:52 -0700, Roedy Green
> <(E-Mail Removed)> 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>
 
Reply With Quote
 
vkj
Guest
Posts: n/a
 
      06-18-2009
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
 
Reply With Quote
 
John B. Matthews
Guest
Posts: n/a
 
      06-19-2009
In article
<(E-Mail Removed)>,
vkj <(E-Mail Removed)> 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>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem: Installing Curb in Mac OS Leopard Maximiliano Caceres Ruby 1 09-14-2009 09:48 PM
Huge problem gettng MySQLdb to work on my mac mini running Macosx10.5 Leopard geert Python 8 03-19-2008 11:47 PM
does anyone know what version of Java comes with the new Mac OS X Leopard? chewie54 Java 5 10-30-2007 02:18 AM
what version python and wxPython comes with Mac OS X Leopard chewie54 Python 1 10-20-2007 06:36 PM



Advertisments