Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frustrating Error

Status
Not open for further replies.

ACRRHODES

Programmer
May 16, 2000
33
CA
Yo. I recently completed my Luge game (you may remember it from a previous thread). It works perfectly in appletviewer at my house, but it:

a) Didn't work in appletviewer at work
b) Didn't work in Netscape at home
c) Didn't work in Netscape at work
d) Didn't work in IE at work
e) Not sure whether it works or not in IE at home...

The error I get with Netscape is :
"security violation: method verification error."

The error in appletviewer at work is:
"file not found when looking for java.awt.Graphics2D java.lang.NoClassDefFoundError."

I know that these errors can be caused by java not being installed, but java is installed on both computers! Do you know how to get around this? ***
Dammit Jim, I'm a programmer, not a doctor.
 
Are you using Java 1.3 or 1.4 at home? Sounds like you might have a later version than is installed in other places. I generally stick to 1.2 or earlier if I want it to work in browsers.
 
You must make sure that you are running the same jvm on all different platforms. This can be kinda tricky as, even though you may have the correct jvm installed in the browser, you have to make sure that the correct jvm is selected in the plug-in control panel. IE has a nasty habit of trying to use its own jvm, that doesn't seem to play real nice with sun's jvm.

As far as appletviewer goes, just make sure you have the same version of the appletviewer when running the applet.

In response to the previos reply, I have used java 1.3 and 1.4 to write applets without any problems, as long as the above rules were satisfied.

-gc
 
What about the 'Graphics2D' error? Here's what I've tried:
- At home, I copied src.jar and rt.jar (the two jar files on my computer containg the Graphics2D class) into the Netscape 'Class' folder. To my amazement, the applet 'loaded' but wouldn't start.

- With the appletviewer, I unjarred rt.jar, extracted Graphics2D.class, and stuck it in the same folder as my applet. I assumed that if I distributed my game along with the Graphics2D class, all my problems would be solved. Again, it gave me the error:
"file not found when looking for java.awt.Graphics2D
java.lang.NoClassDefFoundError."
What the heck?
***
Dammit Jim, I'm a programmer, not a doctor.
 
In the later case, it must not only be in the directory, but in the structure it was in before (i.e. $CURRENT_DIR/java/awt/Graphics2d.class)

In any case I would determine which version the app was compiled with, and then just make sure that the same version is installed on all systems you want to run it on. That is I would install the plug-in for that version on to the system I am running it on.

-gc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top