Java Forum / General / July 2007
Java Applet on Macintosh
Johnny - 06 Jul 2007 18:21 GMT Hi all:
I have a very simple Java applet which runs perfectly on Windows in IE, but when I try to load it in IE on MAC OS 9, I get an error"
An Exception Occurred, ClassNotFoundException for TestApplet
Java Exception: java.lang.NullPointerException.
The Page hosting the Java Applet is being served from Apache, and the code is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD> <BODY> <applet code="TestApplet.class" width=450 height=600> </applet> </BODY> </HTML>
Can anyone offer any advice as to what I can do?
 Signature John.
http://mscrmguy.blogspot.com/
Steve W. Jackson - 06 Jul 2007 19:03 GMT > Hi all: > > I have a very simple Java applet which runs perfectly on Windows in IE, but > when I try to load it in IE on MAC OS 9, I get an error" [ snip ]
> Can anyone offer any advice as to what I can do? Mac OS 9 is officially dead, though a great number of users still stick with it. Its Macintosh Runtime for Java (MRJ) only supported Java 1.1.8, and adding Swing support (early Swing 1.1.1, IIRC) was possible but not pleasant.
Bottom line: don't worry about an applet working for any Mac not running some release of Mac OS X (unless you want to use only Java 1.1.8 or earlier). The earliest releases of Mac OS X included Java 1.3. Java 1.5 (aka Java 5) is now in widespread use in Mac OS X 10.4, and Java 6 is in the works as a "developer preview" -- it's unclear whether it will be made available as a finished product for 10.4, or only with the release of 10.5 coming in October.
= Steve =
 Signature Steve W. Jackson Montgomery, Alabama
Johnny - 06 Jul 2007 19:50 GMT Hi Steve:
Thank you for the reply....My wife has a G5 with Mac OS X 10.3.9, and I cannot get the applet running on that either. I just get a red "X" on the page. Since she ahs 10.3.9 I cannot upgrade to the JDK 5, but I used the JDK v1.6. to build the applet. I guess maybe that's the problem? Do I need to use an earlier SDK?
 Signature John.
http://mscrmguy.blogspot.com/
>> Hi all: >> [quoted text clipped - 19 lines] > > = Steve = Steve W. Jackson - 06 Jul 2007 20:02 GMT > Hi Steve: > [quoted text clipped - 3 lines] > v1.6. to build the applet. I guess maybe that's the problem? Do I need to > use an earlier SDK? Java 6 (1.6) is *only* available as a developer preview and probably not available for 10.3.9 at all. But to get it, you'd need to join the Apple Developer Community (ADC), which you can do for free with an online membership.
In any event, since the Applet was done in 1.6, it won't work in any lower release on *any* platform.
 Signature Steve W. Jackson Montgomery, Alabama
Johnny - 06 Jul 2007 21:51 GMT Hi Steve:
Ok, thanks. I compiled using v1.3.1 and it worked on OS X.
John.
 Signature John.
http://mscrmguy.blogspot.com/
>> Hi Steve: >> [quoted text clipped - 12 lines] > In any event, since the Applet was done in 1.6, it won't work in any > lower release on *any* platform. Roedy Green - 07 Jul 2007 05:49 GMT On Fri, 06 Jul 2007 14:02:55 -0500, "Steve W. Jackson" <stevewjackson@knology.net> wrote, quoted or indirectly quoted someone who said :
>In any event, since the Applet was done in 1.6, it won't work in any >lower release on *any* platform. you need to use the -target option in compile to make it work on earlier JVMS.
See http://mindprod.com/jgloss/javacexe.html -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Andrew Thompson - 07 Jul 2007 06:03 GMT >On Fri, 06 Jul 2007 14:02:55 -0500, "Steve W. Jackson" ><stevewjackson@knology.net> wrote, quoted or indirectly quoted someone [quoted text clipped - 5 lines] >you need to use the -target option in compile to make it work on >earlier JVMS. As well as the '-bootclasspath' option to *guarantee* that no members of post n.n version are used. -target is simply a directive to denote the class file format that is recorded, as I understand it.
 Signature Andrew Thompson http://www.athompson.info/andrew/
Roedy Green - 07 Jul 2007 07:14 GMT >As well as the '-bootclasspath' option to *guarantee* >that no members of post n.n version are used. -target >is simply a directive to denote the class file format that >is recorded, as I understand it. for more details see http://mindprod.com/projects/jdkversion.html and http://mindprod.com/jgloss/javacexe.html -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Andrew Thompson - 07 Jul 2007 08:25 GMT >>As well as the '-bootclasspath' option to *guarantee* >>that no members of post n.n version are used. -target >>is simply a directive to denote the class file format that >>is recorded, as I understand it. ...
>and http://mindprod.com/jgloss/javacexe.html Oh yeah, sorry. I suppose the idea of putting the full information at the link (the same link you posted before my comment) was not to have to go into the minutae of a complex subject. Note to self - "Read the link content".
 Signature Andrew Thompson http://www.athompson.info/andrew/
Andrew Thompson - 07 Jul 2007 08:34 GMT >>>As well as the '-bootclasspath' option to *guarantee* >>>that no members of post n.n version are used. -target >>>is simply a directive to denote the class file format that >>>is recorded, as I understand it. >... >>and http://mindprod.com/jgloss/javacexe.html ..
>...Note to self - "Read the link content". Now I have - I find the specific reference to Eclipse, under the -target details, very odd. That same sentence can apply to Netbeans, JBuilder, TextPad or an Ant build file - not just Eclipse.
But otherwise - good info. - as usual.
 Signature Andrew Thompson http://www.athompson.info/andrew/
Steve W. Jackson - 09 Jul 2007 14:29 GMT > >>>As well as the '-bootclasspath' option to *guarantee* > >>>that no members of post n.n version are used. -target [quoted text clipped - 12 lines] > > But otherwise - good info. - as usual. But none of this is applicable to the OP, who indicated that the system which would not run the applet was Mac OS 9...
 Signature Steve W. Jackson Montgomery, Alabama
Andrew Thompson - 09 Jul 2007 14:39 GMT >> >>>As well as the '-bootclasspath' option to *guarantee* >> >>>that no members of post n.n version are used. -target [quoted text clipped - 4 lines] >But none of this is applicable to the OP, who indicated that the system >which would not run the applet was Mac OS 9... The way I understand it, it does. Indicated elsewhere in the thread was that the machine ran 1.1.8, but the source was being compiled using 1.3.1.
 Signature Andrew Thompson http://www.athompson.info/andrew/
Steve W. Jackson - 09 Jul 2007 16:08 GMT > >> >>>As well as the '-bootclasspath' option to *guarantee* > >> >>>that no members of post n.n version are used. -target [quoted text clipped - 9 lines] > ran 1.1.8, but the source was being compiled > using 1.3.1. I was actually referring to the series of messages that both you and Roedy posted concerning the Java console and numerous other things. The fact is, that OS is defunct and no reliance whatsoever should be placed on its even being able to use applets any longer. But, if great care is taken to use seriously ancient code via the techniques outlined, it *can* work...but it's not wise.
 Signature Steve W. Jackson Montgomery, Alabama
Roedy Green - 07 Jul 2007 05:48 GMT >An Exception Occurred, ClassNotFoundException for TestApplet > >Java Exception: java.lang.NullPointerException. > >The Page hosting the Java Applet is being served from Apache, and the code >is: See if you can turn on a console so you can find out where you are getting the exceptions.
see http://mindprod.com/jgloss/runerrormessages.html#CLASSNOTFOUNDEXCEPTION
Put your class in a package and put the class files in a jar. It must be in the same directory as the HTML page that invokes. See http://mindprod.com/jgloss/applet.html
Make sure Applets in general are working by running http://mindprod.com/japplets/wassup.html -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Free MagazinesGet 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 ...
|
|
|