Forum Stats

  • 3,855,199 Users
  • 2,264,473 Discussions
  • 7,905,928 Comments

Discussions

Applets doesn't work when use J2SDK1.4+ with <applet> tag!

843807
843807 Member Posts: 46,582
edited Oct 26, 2002 11:59AM in Java Applet Development
Recently I encounter the following bug (or just a problem) using Applets with j2sdk1.4.0 (and 1.4.1).
To reproduce the problem just check out the box "Use Java2 v1.4.1 for <applet>" into IExplorer's Advanced settings.
Then try to load some of the examples shipped with SDK package.
BUT!!! Only try those in $JAVA_HOME/demo/applets.
The status "load: class CCCC not found" is produced for all of the examples when the page is loaded, no matter single class or jar file is specified into APPLET tag.
If you check back the oprtion - applets work fine.
Try to execute old applets (written in v1.1, 1.2 or even 1.3) and there is no significanse in the state of the check box.

I also examin this situation ot the PC with JRE v1.2 installed on it - no problems again!

I wonder - is this a bug, unproper configuration of my system (!), or deprecated function in the new JDK/JRE?

Could you discuss this with me?

Thanks in advance!

Comments

  • 843807
    843807 Member Posts: 46,582
    I found a similar problem with applets compiled with J2SDK1.4.1, when trying to load it with IE 5.5 or 6.0 without the java plugin, always I got a "Class not found error" on the myApplet class.

    I think the class produced by JDK 1.4.0 are not compatible with the MS VM.


  • 843807
    843807 Member Posts: 46,582
    Ok, so there's been a lot of discussion in this forum around incompatibility between jdk 1.4x and applets running in IE.

    The standard solution is to deploy a new plug-in. Is there an automatic way of request the user to download the plug-in if they don't already have it?
  • 843807
    843807 Member Posts: 46,582
    There is a way to make an automatic request like that. Before I tell you that though, you should try the following:

    Since the IE 5 & 6 use the 1.1 plugin only, you should attempt to compile your program with:

    javac -target1.1 yourApplet.java

    Then load it in IE. If it works, then good. If it does not, you can use an <object> tag like so:

    <object classid="clsid:CAFEEFAC-0014-0000-0000-ABCDEFFEDCBA" width=100 height=100 codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_0-win.cab#Version=1,4,0,0"><param name="code" value="HelloWorld.class"><param name="archive" value="HelloWorld.jar"><param name="type" value="application/x-java-applet;jpi-version=1.4"><param name="scriptable" value="false"><comment><embed type="application/x-java-applet;jpi-version=1.4" archive="HelloWorld.jar" code="HelloWorld.class" width=100 height=100 scriptable=false pluginspage="http://java.sun.com/products/plugin/index.html#download"></embed></comment></object>

    Any person with HTML logic can figure out where to put there class names in there etc. Here's what that does: it attempts to load the 1.4 plugin, if it is not installed, the user will be asked to download the plugin. Since the plugin is 30MB, you can imagine not many people who visit your site are going to wait that long (seeing as 70% of net surfers are on 56K). So before trying the object tag, try compiling with the 1.1 target so you're viewers won't have to download another plugin.
  • 843807
    843807 Member Posts: 46,582
    - Cut -
    Any person with HTML logic can figure out where to put
    there class names in there etc. Here's what that does:
    it attempts to load the 1.4 plugin, if it is not
    installed, the user will be asked to download the
    plugin. Since the plugin is 30MB, you can imagine not
    many people who visit your site are going to wait that
    long -cut-
    Ehm, the plugin is 9MB...(see http://java.sun.com/products/plugin/index-1.4.1.html). 30MB is the all J2SDK


  • 843807
    843807 Member Posts: 46,582
    The clsid:CAFEEFAC-0014-0000-0000-ABCDEFFEDCBA is valid only if JRE1.1 is installed on client's mashine.
    The valid CLSID is 8AD9C840-044E-11D1-B3E9-00805F499D93 (for version 1.4.0 and 1.4.1!).

    Compiling with target=1.1 is partial solution, because java compiler do not report warnings if you use new methods of the old classes. For example java.awt.Font.class has method deriveFont(AffineTransform trans), which is defined in version 1.2. If I start to look every class which I use in my applet for compatibility with version 1.1 where is the reason to use newer version of the JDK ?!?

    I continue to think that this is a serious mistake in compatibility mode of JDKs.

    Anyway - thanks a lot for the replys! They are very usefull for me.
  • 843807
    843807 Member Posts: 46,582
    I had the same problem many times. I believe that APPLET is one of the most crucial component of Sun's Java to attract new programmers to our side of the competition battle. C# has already took our many java gurus with years of java experience to their side. I think Sun should pay more attention to applets, clarify and resolve many issues in favor of Java's future investment in market share.
This discussion has been closed.