0

Ugh - I'm having to work on something I know little about, so I'm not sure I'm even searching for the right thing.

I have a java applet being served by my website (internal to the company only, unfortunately) and I'm getting a Class Not Found error when folks are accessing it using JRE 1.7/Java 7. It works with JRE 1.6/Java 6.

It works perfectly if I call a demonstration page locally via a browser, when all of the files are in the same folder:

APPLET CODEBASE = "./"
ARCHIVE  = "my.jar"
CODE     = "my.class"
NAME     = "Test"
WIDTH    = 400
HEIGHT   = 150
COL      = 7
HSPACE   = 0
VSPACE   = 0
ALIGN    = top

But what I don't know/understand is when a browser has the JVM download a JAR file - and I'm not certain that my 7 clients are downloading the JAR file - where do those files go? Are they named the same thing? (If they are, and the name is the same, then I know that the files aren't being downloaded, which would explain a lot. Of course, then I need to figure out why they aren't on 7 but are on 6. sigh) Since I can't figure out where those files go, I can't tell if my CODEBASE path is correct, which I think is the actual problem. I can't find the answer via google - but it may be that the question is so basic that the answer isn't out there, or I'm just not looking for the right thing.

Any suggestions, please?

Thanks!

Lee
  • 53
  • 1
  • 1
  • 5
  • See http://stackoverflow.com/questions/5947063/how-to-specify-correctly-codebase-and-archive-in-java-applet - the codebase must be a URL – Joop Eggen Mar 19 '13 at 19:29
  • Interesting - I saw that entry earlier but didn't catch that the codebase had to be an absolute URL path and not a relative one. So I've made that change, and tested the URL to ensure that the file is accessible. I put a packet analyzer on my workstation and I see the request going out to the server for the my.jar file, and it appears to download properly. However, it still isn't executing & Java control panel / view doesn't show it. I've changed the security settings in Java to no avail; it's like there's a disconnect between the download and the (I guess it's the) JRE? – Lee Mar 20 '13 at 17:42
  • If on the server side the classes where compiled for 1.7 there would be a class version error when the client can only read 1.6. One can however compile with Java 1.7 for say 1.5. But that is the other way around when I understand. **Another issue, is that the HTML applet tag is deprecated in favor of the object tag, as standard now in HTML5.** Give that a try. – Joop Eggen Mar 20 '13 at 18:01
  • So now my HTML reads like (per http://www.w3schools.com/html/html_object.asp) and I don't even get the box throwing the java error any more - I'm getting nothing at all where the applet should be running. I'm not getting a class version error - it's not registering the download of the JAR file, so there's no class comparison that could fail yet. – Lee Mar 20 '13 at 18:24

1 Answers1

0

Try

<!DOCTYPE html>
<html>
...

<object type="application/x-java-applet" height="150" width="400">
    <param name="code" value="My" />
    <param name="archive" value="my.jar" />
    No Java plug-in was found.
</object>

for a public class My extends JApplet.

Joop Eggen
  • 107,315
  • 7
  • 83
  • 138