This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Applets and the fly likes Applet not inited Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet not inited" Watch "Applet not inited" New topic

Applet not inited

Alex Grakoff

Joined: Mar 11, 2008
Posts: 8
I have a java applet (a Roulette)

And a php server-side.

So, I want to start applet and it fails:

The code to start applet:

The applet is inited locally:
start.html ( contains the code as above )

If I want to launch it on my local server:

the code is:

/Roulette.jar - as the .jar is located at DocRoot

So, when I open the sites's page, I have:
java.lang.NoClassDefFoundError: Roulette (wrong name: Roulette/Roulette)

That's about IE6, FF2

In Opera Applet is actually loaded! - but without sound.

Can anyone tell me the reason for such behaviour?

Thanks for answers in advance.

-------------------------------<br />Life's great!
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41128
Welcome to JavaRanch.

It sounds as if you have a Roulette class in a package called Roulette (that's what "wrong name: Roulette/Roulette" hints at), while the code attribute of the applet tag specifies that the Roulette class is not in any package. If the class actually is in a package called Roulette, use code="Roulette.Roulette".

Ping & DNS - my free Android networking tools app
Alex Grakoff

Joined: Mar 11, 2008
Posts: 8
You are right, but now I got another message:

somewhere I read that "Incompatible magic value" can happen because of the JRE.

I'm using jre1.6 and the code was compiled using 1.4 - so probably I should compile it with jre1.6 ?

Thank you for the previous reply!
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41128
No, there should be no need to recompile. Anything compiled with 1.4 is usable with 1.6. The other way around it wouldn't work.

But this is a different error message anyway. I'm guessing that the jar file you uploaded is corrupt (maybe you used FTP in ASCII mode instead of binary mode?). Download the jar file to your machine and see if a ZIP utility can open it.
Alex Grakoff

Joined: Mar 11, 2008
Posts: 8
Hi Dear Ulf!

the jar if OK.

it is not corrupted, and in fact I can start it locally (without webserver)

Locally: i.e. there is an .html file and .jar in the same dir.


So, when I open HTML - Applet is loaded correctly.

When I try to open it via webserver, I got:

Incompatible magic value 1008813135

where can I have a look to solve that problem?

Thank you in advance!
Alex Grakoff

Joined: Mar 11, 2008
Posts: 8
besides, if the file had beed corrupted, I think it wouldn't loaded.

but it loads correctly on my PC.

btw: I test everything on my local PC. i.e. Webserver is on my PC.

and the file is located at the same place.

I just put .html at


and the URL to open via server:
I agree. Here's the link:
subject: Applet not inited
Similar Threads
Loading an applet
Java plug-in?
Problems while Loading Applet...
Newbie's problem with applet
Applet Plugin create two instances of applet.