Java Forum / First Aid / March 2004
IE & applets
Lazy70 - 25 Mar 2004 14:22 GMT Hi, I'm a newbie in this topic, so sorry if my question is stupid.
I have problems with some applets in IE 6. In some machine this applets work fine, in other not. The error message I have in Java Console is an java.lang.ClassNotFoundException exception.
How is it possible that some browsers find correctly all the classes needed to run applet and some not? Does it depend about VM used? It's very strange, don't you?
Other suggestions?
Thanks Ktrl+S
Princess Morgiah - 25 Mar 2004 22:10 GMT > Hi, I'm a newbie in this topic, so sorry if my question is stupid. > [quoted text clipped - 8 lines] > > Other suggestions? Hi Lazy70,
It does depend on the VM - every browser with Java support needs to have a VM to run your applets. Some browsers use the VM that came with it, others use your locally installed VM, which of course is dependent on which version you have installed.
Other suggestions? - limit yourself to a known-good-configuration: for applets, just about anything that's available in 1.1.8 will run on almost any browser (with Java support, of course) - inform your user that your applet needs version x - be advised that most users are not willing to install additional software just for your applet.
Princess Morgiah
Lazy70 - 26 Mar 2004 10:11 GMT > - limit yourself to a known-good-configuration: for applets, just about > anything that's available in 1.1.8 will run on almost any browser (with Java > support, of course) > - inform your user that your applet needs version x - be advised that most > users are not willing to install additional software just for your applet. Ok, I will test it, thank you very much Ktrl+S
Tom - 25 Mar 2004 22:50 GMT > Hi, I'm a newbie in this topic, so sorry if my question is stupid. > [quoted text clipped - 11 lines] > Thanks > Ktrl+S For a newbie, your question is almost expected. You don't mention what class wasn't found, so I may not address your particular problem. The easy answer is don't use IE. I switched to Mozilla a couple of years back and I have never regretted it. But that is another issue.
Any browser made by Microsoft has the potential to have problems with applets created in Java. This is due to the fact that IE ships with a VM that is NOT 100% compatible with the Sun standard. In fact, this has been the central issue in multiple lawsuits against MS by Sun.
Even if you have installed Java and installed the plug-in, IE may still be set to use its own VM for Java applets unless the webpage has code in it to force the use of the plug-in. You can change the setting so IE uses Sun's VM, which may solve this particular problem.
You should know, however, that there are two reasons that some people prefer to leave the situation the way it is. One is that since the MS virtual machine is more closely integrated with IE, it will start up more promptly. The other is that some sites still have applets that were written to use API in the MS version of Java that were non-standard. As you might expect, those sites won't work in any browser *except* IE and they won't work with the Java plug-in. In a very real sense, those applets aren't really written in Java, they are written in something that is just "close to" Java.
It was these non-standard API's that got MS sued in the first place. It also lead to another possible cause of your problem - version differences. The courts ruled against MS, and as a result, the MS VM is stuck at version 1.1.8. Sun is currently distributing version 1.4.x and version 1.5 has been released as a beta. Other Java VM licensees are at similar levels.
The applets in question may contain code that was created in a later version than the MS VM can handle. Unless the webpage has the right code to force the use of the plug-in (assuming that it is installed), the code can't work on IE.
I blame MS for not playing nice. Sadly, it is the consumer that suffers.
Lazy70 - 26 Mar 2004 10:20 GMT > For a newbie, your question is almost expected. You don't mention > what class wasn't found, so I may not address your particular problem. it's not a Sun class, is a third party class
> The easy answer is don't use IE. I switched to Mozilla a couple of > years back and I have never regretted it. But that is another issue. Unfortunately my site is publi, so I can be able to know what browser users use. However my problem is the same in IE and in netscape. I have said IE in prevoius post because my suspects about double JVM were strong
> Any browser made by Microsoft has the potential to have problems with > applets created in Java. This is due to the fact that IE ships with a > VM that is NOT 100% compatible with the Sun standard. In fact, this > has been the central issue in multiple lawsuits against MS by Sun. I'm not agree about this point of view. In my (little) experience I have other problems with other browser, other SO, etc. Sometime is Sun JVM that is not platform - indipendent, even if often all works fine.
Thanks for your answer Bye Ktrl+S
Tom - 26 Mar 2004 17:00 GMT > > For a newbie, your question is almost expected. You don't mention > > what class wasn't found, so I may not address your particular problem. > > it's not a Sun class, is a third party class That may be the source of the problem. If you did not write it, you can't be sure what version of Java was used to create it. It may using a version that is too new for the browser. IE's version of Java is over 4 years old!
> > The easy answer is don't use IE. I switched to Mozilla a couple of > > years back and I have never regretted it. But that is another issue. [quoted text clipped - 4 lines] > I have said IE in prevoius post because my suspects about double JVM were > strong It wasn't clear from your first post whether you were writing code or just trying to get your browser to work. Obviously, if you are trying to create the applet, you cannot control what browser is used.
What version of Netscape are you using? Older versions of Netscape (4.7 and earlier) will have the same problem as IE. Newer versions of Netscape usually come with a more modern version of Java.
> > Any browser made by Microsoft has the potential to have problems with > > applets created in Java. This is due to the fact that IE ships with a > > VM that is NOT 100% compatible with the Sun standard. In fact, this > > has been the central issue in multiple lawsuits against MS by Sun. > > I'm not agree about this point of view. You are welcome to disagree, but it is more than just a point of view - it is a fact - proven in courts of law. IE is the only browser on the market that ships with a non-standard, 4 year old version of Java that will not work on any other platform!
> In my (little) experience I have other problems with other browser, other > SO, etc. > Sometime is Sun JVM that is not platform - indipendent, even if often all > works fine. Obviously, English in not your first language. That is OK. I'm sure you are doing better in English that I would in your language. I think I know what you are trying to say, so I'll reply based on that understanding.
You are probably correct that the Sun JVM isn't perfect. What is? But Java is Sun's creation. It owns Java and all third-party versions of Java are required to be compatible with Sun's version. So if you stick with a Sun-compatible version, whether it is written by Sun, IBM, Blackdown, Apple, or some other licensee, you can rest assured that the version that you are using has been tested to be 100% compatible. The ONLY version out there that failed the test is Microsofts version. (I'm sure others failed, but they weren't released until they passed.)
Also, don't forget that some sites were created with Microsofts version. That can mean that they will ONLY work with the MS version (depending on what API they used). That is part of the reason that MS was sued and lost.
And even in tested versions, code written with version 1.4 may not run on a version 1.3 JVM. At least with Sun, you can always get the newer version. The MS version will never be updated.
Actually, you can get older versions from Sun as well. One option is to download version 1.1 from Sun and use it to create your applet. If your code will compile with version 1.1, it should work on most browsers - including IE. Just don't be surprised if your third-party class won't compile with the older version. I suspect that that is the source of the problem.
A better long-term option is to write the HTML so it forces the browser to use the plug-in. That lets you write with the latest version and lets the user see the applet with the latest version. If someone doesn't have the correct version of the plug-in (or doesn't have the plug-in at all), the browser will inform them of the deficiency and let them download it. Basically, it is the same system used by things like Flash or QuickTime. I believe some of the other replies have links that explain how to do that so I'll let you refer to them.
Lazy70 - 29 Mar 2004 08:59 GMT > That may be the source of the problem. If you did not write it, you > can't be sure what version of Java was used to create it. It may > using a version that is too new for the browser. IE's version of Java > is over 4 years old! Ok, now I try to find the author and ask him what JVM he have used There is a tool to know it analyzing the .class file?
> > > Any browser made by Microsoft has the potential to have problems with > > > applets created in Java. This is due to the fact that IE ships with a [quoted text clipped - 7 lines] > the market that ships with a non-standard, 4 year old version of Java > that will not work on any other platform! I'm agree about your argumentations about the M$ VM, but it's a matter of fact that in my past experiences I had some problems also with applets that not work on some enviroments (i.e. Apple computers) also if I have used Sun JVM. In other enviroments with the same version of Sun VM they run normally.
So "not all that shining is gold" (I don't know if it's the right sentence in English, but in Italian, my language, it sounds fine :) )
> Obviously, English in not your first language. That is OK. I'm sure > you are doing better in English that I would in your language. I don't know, my English is terrible, I think :)
> A better long-term option is to write the HTML so it forces the > browser to use the plug-in. That lets you write with the latest [quoted text clipped - 5 lines] > replies have links that explain how to do that so I'll let you refer > to them. Thanks for the hints, I will try to find the correct version of JVM and I test when applet run correctly.
Bye Ktrl+S
Tom - 30 Mar 2004 04:00 GMT > > That may be the source of the problem. If you did not write it, you > > can't be sure what version of Java was used to create it. It may [quoted text clipped - 3 lines] > Ok, now I try to find the author and ask him what JVM he have used > There is a tool to know it analyzing the .class file? There is no such tool that I am aware of.
Can you post the entire error message? In addition to ClassNotFoundException, it should mention what class was not found. That could help identify the problem.
<snip>
> I'm agree about your argumentations about the M$ VM, but it's a matter of > fact that in my past experiences I had some problems also with applets that > not work on some enviroments (i.e. Apple computers) also if I have used Sun > JVM. > In other enviroments with the same version of Sun VM they run normally. Sadly, nothing is perfect. I had a similar experience on an Apple with one of my favorite online games. But, based on the type of error that you are getting, it is highly likely that the MS VM is the culprit.
> So "not all that shining is gold" (I don't know if it's the right sentence > in English, but in Italian, my language, it sounds fine :) ) In English, it is "all that glitters is not gold." And, you are correct that Sun's VM is not perfect, nor is Apple's.
> I don't know, my English is terrible, I think :) Much better than my Italian - or even my Spanish (which I actually have studied).
> > A better long-term option is to write the HTML so it forces the > > browser to use the plug-in. That lets you write with the latest [quoted text clipped - 8 lines] > Thanks for the hints, I will try to find the correct version of JVM and I > test when applet run correctly. I think you have misunderstood this last part. The newest version of Java contains hundreds of classes that did not exist when the MS VM was created. Additionally, hundreds of new methods have been added to the older classes. If this third party class uses any of those new classes or methods, then your applet will never run with the MS VM because that VM will not have access to those newer classes.
You probably cannot change the third party class. But, you CAN set up your site so the browser calls up the Java plug-in or prompts the user to install it if they do not currently have it. I suspect that this is your best option.
Lazy70 - 30 Mar 2004 08:14 GMT > Can you post the entire error message? In addition to > ClassNotFoundException, it should mention what class was not found. > That could help identify the problem. complete message is java.lang.ClassNotFoundException: xebec.app.CoursePlayerApplet
The application is a course on line and this applet is useful to view the course.
> I think you have misunderstood this last part. The newest version of > Java contains hundreds of classes that did not exist when the MS VM [quoted text clipped - 7 lines] > to install it if they do not currently have it. I suspect that this > is your best option. Yes, I have understood, I have explained it in a strange way.
Bye Ktrl+S
Tom - 30 Mar 2004 15:33 GMT <snip>
> complete message is java.lang.ClassNotFoundException: > xebec.app.CoursePlayerApplet This is a different problem than I had anticipated. Is this the third party class that you were referring to?
You said the applet doesn't work in IE. Does it work in appletviewer? Have you tried other browsers like Mozilla or Opera?
tom
Lazy70 - 31 Mar 2004 08:05 GMT > <snip> > > complete message is java.lang.ClassNotFoundException: > > xebec.app.CoursePlayerApplet > > This is a different problem than I had anticipated. Is this the third > party class that you were referring to? Yes
> You said the applet doesn't work in IE. Does it work in appletviewer? > Have you tried other browsers like Mozilla or Opera? On Netscape it works
Tom - 31 Mar 2004 16:15 GMT > > "Lazy70" <s.pulvirenti@katamail.com> wrote in message > news:<c4b6na$2gt95v$1@ID-111830.news.uni-berlin.de>... [quoted text clipped - 11 lines] > > On Netscape it works What version of Netscape?
What JVM is Netscape using?
Is the website working yet? If so, what is the URL?
Lazy70 - 31 Mar 2004 16:55 GMT > > On Netscape it works > > What version of Netscape? from 6.1 and over
> What JVM is Netscape using? I think Sun 1.3
> Is the website working yet? If so, what is the URL? No, unfortunaly is off line
Tom - 31 Mar 2004 21:48 GMT > > "Lazy70" <s.pulvirenti@katamail.com> wrote in message > news:<c4dqim$2hp31r$1@ID-111830.news.uni-berlin.de>... [quoted text clipped - 11 lines] > > No, unfortunaly is off line If it works in Netscape 6.1 with Sun 1.3 JVM, but not in IE with the MS JVM, then the third party file must be using some API that is not in the older version.
Have you tried the HTML converter? If not, you may want to.
Open a DOS prompt in the folder that has the HTML page. The syntax is htmlconverter <yourfilename.html>
It will back up your original webpage, and produce a copy with the correct code to start the Sun JVM.
Andrew Thompson - 26 Mar 2004 03:24 GMT > I have problems with some applets in IE 6. Princess Morgiah and Tom have filled you in on most of what you need to know, but I will add a couple of URL's..
Why you cannot expect Java in _any_ browser. <http://www.physci.org/codes/java/plugin.jsp>
A way to ensure a browser has the Java minimum version required for your applets. <http://www.physci.org/codes/jre.jsp>
Some of MS' latest games.. <http://www.physci.org/test/jvmclean/>
 Signature Andrew Thompson http://www.PhySci.org/ Open-source software suite http://www.PhySci.org/codes/ Web & IT Help http://www.1point1C.org/ Science & Technology
Erwin Moller - 26 Mar 2004 09:38 GMT > Hi, I'm a newbie in this topic, so sorry if my question is stupid. > [quoted text clipped - 11 lines] > Thanks > Ktrl+S Morgiah, Tom and Andrew said it all, but I would like to add 1 thing: If you decide to target the 1.1.8 JVM, which runs inside many M$ browsers, AND you use a modern Java yourself, be sure to add the target-tag when compiling. This will force the compiler to create bytecode suited for the older JVM's. (Hope I said this correct.) If I remember well that solved a few problems for me when I thought I was only using the old (1.1.8) API, but IE refused to load them.
Regards, Erwin Moller
Andrew Thompson - 26 Mar 2004 21:57 GMT >> Hi, I'm a newbie in this topic, so sorry if my question is stupid. >> [quoted text clipped - 13 lines] > > Morgiah, Tom and Andrew said it all, Did we?!?
> ..but I would like to add 1 thing: Well, apparently not _everything_ ;-)
> If you decide to target the 1.1.8 JVM, which runs inside many M$ browsers, > AND you use a modern Java yourself, be sure to add the target-tag when > compiling. This will force the compiler to create bytecode suited for the > older JVM's. > (Hope I said this correct.) Almost. There are two compile parameters involved in what you are referring to..
The '-target' flag is used to ensure that the class files are _readable_ by a particular VM (or later ones).
So, a project might use this option where the application checks for the existence of Swing, and, if not present, use an AWT interface.
> If I remember well that solved a few problems for me when I thought I was > only using the old (1.1.8) API, but IE refused to load them. In order to ensure you are only using classes from 'up to' a particular release, you need to invoke the -bootclasspath option, and point it to the jar in question.
To put it another way, you need to compile your classes, telling the compiler to assume _only_ the classes from that release are present. The project described above, with AWT/SWing, would fail if you tried to compile it with -bootclasspath pointing to a 1.1 rt.jar.
For convenience, I have put most jars (so you can play with both options) here, <http://www.physci.org/javac.jsp> the compilation options are down the bottom of the page.
Maybe, if Neal G. is floating around, he can add even further subtleties on this arcane information.. ;-)
 Signature Andrew Thompson http://www.PhySci.org/ Open-source software suite http://www.PhySci.org/codes/ Web & IT Help http://www.1point1C.org/ Science & Technology
Andrew Thompson - 30 Mar 2004 04:10 GMT > I have problems with some applets in IE 6. > In some machine this applets work fine, in other not. I post this now that you have made various meandering posts here, to suggest, give us an _URL_!!
An URL paints a thousand pictures, and makes Applets much easier to debug.
[ I have various way to fix the problem maybe, but I must see Applet break for myself. ]
 Signature Andrew Thompson http://www.PhySci.org/ Open-source software suite http://www.PhySci.org/codes/ Web & IT Help http://www.1point1C.org/ Science & Technology
Lazy70 - 30 Mar 2004 08:16 GMT > > I have problems with some applets in IE 6. > > In some machine this applets work fine, in other not. [quoted text clipped - 5 lines] > An URL paints a thousand pictures, > and makes Applets much easier to debug. Unfortunately the site is not on line at this time, so it's impossible at the moment to access it :(
Ktrl+S
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 ...
|
|
|