Go Back   The macosxhints Forums > Working with OS X > OS X Developer



Reply
 
Thread Tools Rate Thread Display Modes
Old 05-17-2010, 07:55 PM   #1
CoderMan
Prospect
 
Join Date: May 2010
Posts: 4
Question Java applet issues on Mac OS X

Hi. I've been wandering around the web trying to find an explanation for some quirky Mac OS X behavior that has been an issue for me in a programming project for work. I was hoping someone here might have some insight.

A really important component of our project is a Java applet I developed. Most of the staff here use Mac OSX and Linux, so cross-platform compatibility is important. Java bytecode is, of course, supposed to work on any operating system, as long as it has the virtual machine and a browser plug-in.

The quirky behavior, though, is that if I compile my source code on my Linux server, using javac (-source 5) the code will work fine inside Windows (IE), and Linux (Firefox), but not on Mac OS X (Firefox or Safari).

However, if I take the exact same source code, and compile it using javac (-source 5) on a Mac OSX computer (then upload it to the web server), the Java applet will work whether I view it on Windows, Firefox, or Mac OS X. This is confusing to me, because Java bytecode is supposed to be platform independent. Also, it is a real bother, because the source code is developed and stored on the Linux server, meaning I have to scp source code and class files all over the place if I want the applet compiled on a Mac.

Does anybody have any idea why this is, and if there is anything I can do about it? Thanks.
CoderMan is offline   Reply With Quote
Old 05-18-2010, 01:14 AM   #2
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 32,292
Maybe different point versions of Java 5 ?

What exactly is the problem? Error messages etc.
__________________
hayne.net/macosx.html
hayne is online now   Reply With Quote
Old 05-18-2010, 11:36 AM   #3
CoderMan
Prospect
 
Join Date: May 2010
Posts: 4
Quote:
Originally Posted by hayne
Maybe different point versions of Java 5 ?

What exactly is the problem? Error messages etc.

Frustratingly, there is no error message. The Java console displays nothing, and the applet box simply displays a red "X" instead of the actual applet.

In summary: Code compiled using javac on a non-macintosh platform will not display when viewed in a web-browser on a Macintosh system, with the Macintosh system providing no useful information as to why this is the case. The code must be compiled on a Macintosh system in order to be viewed by a Macintosh browser. This is a problem because it is contradictory to Java's portability designs, and it is a pain in the arse to have to transfer the code to a Macintosh system when I want to have it compiled.
CoderMan is offline   Reply With Quote
Old 05-18-2010, 02:04 PM   #4
CoderMan
Prospect
 
Join Date: May 2010
Posts: 4
Update

Additional testing has revealed that the problem I described occurs on our systems which are running Mac OS version 10.5 "Leopard". But it does not occur on our systems which are running Mac OS version 10.6 "Snow Leopard". Though I still not clear on the details of this issue, the most likely explanation is that there is a defect in the Java implementation for the older OS, which has been corrected in the newer release.
CoderMan is offline   Reply With Quote
Old 05-18-2010, 02:19 PM   #5
tw
Hall of Famer
 
Join Date: Apr 2007
Posts: 4,262
Quote:
Originally Posted by CoderMan
Additional testing has revealed that the problem I described occurs on our systems which are running Mac OS version 10.5 "Leopard". But it does not occur on our systems which are running Mac OS version 10.6 "Snow Leopard". Though I still not clear on the details of this issue, the most likely explanation is that there is a defect in the Java implementation for the older OS, which has been corrected in the newer release.

"defect" is probably too strong a word. the non-Apple software that ships with Apple OSes is always a few months older than the original shipping date of the CD (which is a few years now for Leopard). unless you've made a point of updating javac, or Apple thought there was a significant enough change to include a javac update in one of its system updates, the version of javac on your leopard machines might be older than the version on your linux machines. try javac -version on the various boxes and see what they says.
__________________
Philosophy is a battle against the bewitchment of our intelligence by means of language. -LW-
tw is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump



All times are GMT -5. The time now is 05:12 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.