File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes Adding Java to a Website Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Adding Java to a Website" Watch "Adding Java to a Website" New topic

Adding Java to a Website

Erer erer

Joined: Sep 09, 2012
Posts: 2
I am having trouble adding a java application to a webpage. Can I get some help?

I used

<APPLET CODE="Project1.class" HEIGHT=500 WIDTH=500></APPLET>

to load it to the page, but I keep getting when on the page.


Incompatible magic value 791627122 in class file Project1
Paul Clapham

Joined: Oct 14, 2005
Posts: 19847

That means that when the applet's container (i.e. the browser) asks for Project1.class from the server, the server gives it something which isn't a Java class.

Let's find out what: the first 4 bytes of it are 791627122 as a decimal number. As a hexadecimal number (get out your calculator which does the conversion) it's 2F2F4572. And converting to characters, that's "//%H".

So whatever your server is returning, it isn't a Java class. It's some kind of text, maybe an error page or something, which starts with "//%H". Check and repair your server configuration.
Erer erer

Joined: Sep 09, 2012
Posts: 2
My Javascript runs fine in Netbeans

and im sure not how to perform the function you specified in your post
I agree. Here's the link:
subject: Adding Java to a Website
It's not a secret anymore!