# Help With Java



## dcf-joe (Jul 30, 2007)

I have a website on freewebs.com. I have uploaded a file called BodyMassApplet.html onto the website. I go to the HTML editor, and type in:

However, whenever I go to view my website, the java applet won't load. I have the latest runtime environment 1.6.03. 
HELP PLEASE


----------



## Chicon (Jul 29, 2004)

Hi dcf-joe,

You still have to upload the BodyMassApplet.class file on your website to solve the problem.


----------



## dcf-joe (Jul 30, 2007)

I already did upload the file.


----------



## tomdkat (May 6, 2006)

Your browser should have a "Java Console" you can open to see if any Java exceptions are being thrown. Find that console and open it and post any Java errors you are getting.

Peace...


----------



## dcf-joe (Jul 30, 2007)

These are the errors as according to Firefox's Java Console:

java.lang.ClassFormatError: Incompatible magic value 1008813135 in class file BodyMassApplet
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


----------



## tomdkat (May 6, 2006)

Sounds like your BodyMassApplet.class file is corrupt somehow. How did you upload it to the server? I would recomile BodyMassApplet.class, just to make sure it's cleanly compiled and upload it to the server using a *binary* transfer method, not ASCII (plain text).

See what happens.

EDIT: Ok, based on this thread, it sounds like the JVM is having difficulty locating your Java class. Java is case sensitive so make sure the BodyMassApplet.class file name is mixed case on the server.

Peace...


----------



## dcf-joe (Jul 30, 2007)

This is how I uploaded it:

I went into TextPad, opened up my BodyMassApplet.html file. When the file opened up, I copied the text and pasted it onto my website with the HTML editor. I had previously uploaded the actual BodyMassApplet.java file onto the website.


----------



## tomdkat (May 6, 2006)

The problem isn't with the HTML file, it looks like it might be the location of the Java class file. Now, if you uploaded BodyMassApplet.java and NOT BodyMassApplet.class, that is probably the problem. You need to compile the .java file (the source) to a .class file (the executable code) and upload the .class file to your server using a binary transfer method.

How did you upload BodyMassApplet.java?

Peace...


----------



## dcf-joe (Jul 30, 2007)

Thanks for your help guys. I realized that I uploaded the HTML file, and then called the HTML file with my insertion of the html text. The actual class file was never there, so the call didn't know what to do. So, I uploaded the class file, and the applet works. Once again, thanks guys!


----------



## tomdkat (May 6, 2006)

Great! Glad you got it sorted out. 

Peace...


----------

