• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 527
  • Last Modified:

Java Applet loads fine in NS7 but Grey Boxes in IE6

Hi:

I've been able to successfully get Java Applets to load properly when I run them in Netscape 7.0 but I get the Grey Box of Java Death when I try completely simple code like

<APPLET CODE="ShowApplet.class" WIDTH=300 HEIGHT=300> Your Browser Does Not Support Java </APPLET>

I know that since NS7 displays this just fine (the ShowApplet class is a simple Applet from O'Rielley's Learning Java CH22, it does exactly what the book says both in NS7 and in AppletViewer) that the HTML and the Java code is fine and that all the files are in the right places (i'm pretty sure).

When I run IE6 and view this I get a Grey Box.  What gives?  Does MS hate Sun that much?  If this happens to me then will it also happen to people who view my pages when I finally put them on a server?

Thanks,

J!
0
styles17
Asked:
styles17
  • 11
  • 8
  • 3
  • +1
1 Solution
 
cheekycjCommented:
you should ask this in the browser section but just out of curiosity.. do you have JRE and/or Java Plugin installed?  You may have the IE that didn't come with the Java VM.

download the JRE:
http://java.sun.com/j2se/1.4.1/download.html [though I prefer the 1.3.1 JRE]
and you can also get the Java Plugin:
http://java.sun.com/products/plugin/index.html

CJ
0
 
kennethxuCommented:
>> If this happens to me then will it also happen to people who view my pages when I finally put them on a server?
right, so you should change you applet tag to something else, you'll find the detail what else means here:
http://java.sun.com/j2se/1.4/docs/guide/plugin/developer_guide/using_tags.html
0
 
styles17Author Commented:
Okay.  I went and grabbed the plugin just to be sure.  I still have the same problem.

I'm running Apache Tomcat 4.1.12 and i've got j2sdk1.4.0, I do see a JRE directory in the middle of all this so I figure this is the runtime environment that you're mentioning (i'm running the server on my local, i've only got one system at home).

Other stuff I can say is that i've got version 6.0.2600 of IE and this is on Win98.

I have taken a glance at the <OBJECT> and <EMBED> tags, i'll probably switch over to those when I figure out HTML converter.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
kennethxuCommented:
go to control panel, open plug-in, go to browser tag, and check "microsoft internet explorer"
0
 
styles17Author Commented:
Okay, I've done that.  Still having the problem.

Thing is that with installing the newer Plug-In as suggested before, I'm finding that

1)  I have 2 control panels.  One is simply Java Plug-In, the second is Java Plug-In 1.4.0.

2)  No matter what settings i'm making in the control panels, I never see the drop-down menu tag for Java Console in IE6... I used to see this before and I'd like to be able to trace the execution.
0
 
cheekycjCommented:
Goto Tools->Java Console  That should show any error messages.

CJ
0
 
styles17Author Commented:
Okay, here's the kicker.

I know I can get the Java Console up and going in NS7.  So i've seen that before.

In IE6 from what i'm seeing, I do find the Tools->Java Console on the drop down (didn't this used to be under the View instead?) but I don't get any response.... which i'm starting to think should tell me something, but short of tearing everything down and reinstalling from scratch i'm not sure what.
0
 
cheekycjCommented:
maybe your Java install didn't go right.  If you can try uninstalling both plugins (1.4 and 1.3 versions - I think you have both installed) and try re-installing one of them.

do you have the applet up somewhere on the web so we can take a look it with our IE6 browsers.

CJ
0
 
styles17Author Commented:
Okay, here's what i've been able to figure out from this morning.

I wound up going to http://java.sun.com/docs/books/tutorial/uiswing/start/swingApplet.html

This has a simple test Applet that Sun serves up to me through my IE6.  Which works fine.

Observations are that just by getting served the applet, this brings up my Java Console on IE6.  Funny thing is that I still can't drop down menu for it from just using IE6.

I'm starting to wonder if doing the HTML converter to get things out of <APPLET> and into <OBJECT> and <EMBED> is the real key to all this?
0
 
cheekycjCommented:
look at their code:
<!--"CONVERTED_APPLET"-->
<!-- CONVERTER VERSION 1.1 -->
<SCRIPT LANGUAGE="JavaScript"><!--
    var _info = navigator.userAgent; var _ns = false;
    var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
//--></SCRIPT>
<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
    var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0)));
//--></SCRIPT></COMMENT>

<SCRIPT LANGUAGE="JavaScript"><!--
    if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 50  codebase="http://java.sun.com/products/plugin/1.1.2/jinstall-112-win32.cab#Version=1,1,2,0"><NOEMBED><XMP>');
    else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.1.2" java_CODE = "HelloSwingApplet.class" java_CODEBASE = "example-swing" java_ARCHIVE = "applets.jar" WIDTH = 400 HEIGHT = 50   pluginspage="http://java.sun.com/products/plugin/1.1.2/plugin-install.html"><NOEMBED><XMP>');
//--></SCRIPT>
<APPLET CODE = "HelloSwingApplet.class" CODEBASE = "example-swing" ARCHIVE = "applets.jar" WIDTH = 400 HEIGHT = 50 ></XMP>
<PARAM NAME = CODE VALUE = "HelloSwingApplet.class" >
<PARAM NAME = CODEBASE VALUE = "example-swing" >
<PARAM NAME = ARCHIVE VALUE = "applets.jar" >

<PARAM NAME="type" VALUE="application/x-java-applet;version=1.1.2">

</APPLET>

</NOEMBED></EMBED></OBJECT>


<!--
<APPLET  CODE = "HelloSwingApplet.class" CODEBASE = "example-swing" ARCHIVE = "applets.jar" WIDTH = 400 HEIGHT = 50 >


</APPLET>
-->
<!--"END_CONVERTED_APPLET"-->


CJ
0
 
cheekycjCommented:
try the same code just put in your applet's info in.

CJ
0
 
styles17Author Commented:
CJ:

This is a whole lot better.

I'm actually getting a Java Console in IE6.... dunno where this magically appeared from though.

I don't get a Grey Box of Death anymore.  I get a whitebackgrounded caption in the box dimensions saying "Loading Java Applet..." which I think is good progress for me today.

The Console is telling me the following:

Opening http://localhost:8080/ora/ch5/example-swing/HelloSwingApplet.class no proxy
load: class HelloSwingApplet.class not found.
java.lang.ClassNotFoundException: HelloSwingApplet
     at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:370)
     at sun.applet.AppletPanel.createApplet(AppletPanel.java:456)
     at sun.applet.AppletPanel.runLoader(AppletPanel.java:389)
     at sun.applet.AppletPanel.run(Compiled Code)
     at java.lang.Thread.run(Thread.java:459)

What i've done is i've taken their .java source for HelloSwingApplet, done a javac on that to get the .class file.  Then i've gone and done a jar of all the classes in my j2sdk/bin directory so that i'd figure i'll get everything that needs to get included.  I put the .class, .java and the .jar into both the same directory as the HTML that I coppied over and also duplicates into a subdirectory called example-swing.

I'm just trying a shotgun approach to getting this working, I don't have a lot of brainpower today to figuring out all the nuts and bolts.  I think it's almost there.

Problem is that this code doesn't work in NS7 all of a sudden.
0
 
styles17Author Commented:
Correction.  The code works just fine on NS7.  Dunno why it didn't come up half an hour ago.
0
 
cheekycjCommented:
that seems to be a path problem.

Did you try the code with your applet?

CJ
0
 
styles17Author Commented:
Okay.  I've played around with things a bit.  Seems like doing a cut and paste on the applet code nets me a few too many comments, these were commenting out a few important things I think.

The new info is that my NS7 console tells me it's using JRE of 1.4.0 which seems right.  I think the real culprit is that the console on IE6 tells me that it's using JRE version 1.1.8 and I get the following dump:

Opening http://localhost:8080/ora/ch5/applets.jar no proxy

java.lang.ClassFormatError: Bad major version number
     at java.lang.ClassLoader.defineClass(ClassLoader.java:212)
     at java.lang.ClassLoader.defineClass(ClassLoader.java:190)
     at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:241)
     at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:386)
     at sun.applet.AppletPanel.createApplet(AppletPanel.java:456)
     at sun.applet.AppletPanel.runLoader(AppletPanel.java:389)
     at sun.applet.AppletPanel.run(Compiled Code)
     at java.lang.Thread.run(Thread.java:459)

So, I guess the real question I should ask:  is there any way to get IE to use a different version of JRE, or should I just re-install things (but would that be just IE, just JRE, or all of it)?
0
 
cheekycjCommented:
just a good read:
http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/applet_tag.html#applet

about using Java Plugin for IE run the Java Plugin Control Panel:
From the Windows Control Panel, double-click the Java coffee-cup icon labeled Java Plug-in to launch the Java Plug-in Control Panel. [for you make sure you run the 1.4.1 one]  Now, goto the browsers panel and select IE.
http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/control_panel.html#browser

Good info on the Plugin (including developer faq):
http://java.sun.com/products/plugin/plugin.faq.html

CJ
0
 
cheekycjCommented:
also make sure (just in case) you disable microsoft's vm:

You can enable (or disable) the use of MS JVM 1.1 and change the security settings at the "Extra" menu with "Internet Options". In the "Advanced" tab, scroll down to "Microsoft VM".  Uncheck all of the boxes in that section (should be 3 of them)

CJ

0
 
kennethxuCommented:
>> You can enable (or disable) the use of MS JVM 1.1 ......
CJ, This doesn't disable ms jvm.

uninstall all jdk, jre from control panel, and re-install jdk1.4.

make sure let it integrate with IE when you install JDK1.4.

in my earlier suggest: go to control panel, open plug-in, go to browser tag, and check "microsoft internet explorer"

try to check/uncheck and make sure close all browser windows.
0
 
cheekycjCommented:
kennethxu: I read on an applet site that it should work, so I figured it would.  I haven't tried it myself.

another option:
http://homepage1.nifty.com/emk/vmselect_e.html

has gotten good reviews and uses a system tweak to force IE to use the Java Plugin.

CJ
0
 
styles17Author Commented:
Hey!

I finally got it to work.  I uninstalled the JREs and SDKs and reinstalled off of 1.4.0 .... i'm having a heck of a time downloading the 35 Megs of 1.4.1 but i'll let that chew overnight.

Thanks to both kennethxu and cheekcj, they've both been a real help.

I'd like to increase the points for this question to 200, split it both between the two of them and close this.... any simple way of doing that?
0
 
cheekycjCommented:
Glad to hear you got it to work.

I will have a Moderator process the split for you.

CJ
0
 
CerebroCommented:
Processing Split.

I have reduced the pts to 100.

styles17:
Please accept an answer for for either cheekycj or kennethxu here.

Then create a new question called for the other expert like:
"Pts for kennethxu for help in qid: 20523211" worth 100 pts.

If you have any questions please ask.

Cerebro
Community Moderator
Experts Exchange
0
 
cheekycjCommented:
Thank you for the "A"

CJ
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 11
  • 8
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now