8

I have created a java applet (.class file) and made a .jar with it and digitally signed the .jar file. Now I need to run the .jar as an applet in firefox. What do I put in the html code to run the .jar file as an applet? I tried and it doesn't work, it tries to get a .class file, how do I load and run my applet as a .jar file using the applet tag in Internet Explorer and Firefox? I searched on the internet and could not find an answer.

1
  • 1
    Note that any data in the applet tag parameters is not signed, and so may be replaced by a malicious third party. So don't trust it. Commented Jun 6, 2010 at 18:03

2 Answers 2

12

http://java.sun.com/docs/books/tutorial/deployment/jar/run.html

should work

<applet code=TicTacToe.class archive="TicTacToe.jar" width=120 height=120> </applet> 

(The class has your main() I assume, the jar is the entire thing)

Sign up to request clarification or add additional context in comments.

2 Comments

+1 Sorry to jump in like that, but I thought I saw a different link.
Thanks, that works, it fixed my problem. I needed to put archive into the applet tag, now it works and my applet loads successfully.
5

What doesn't work? Any errors? Does it show up at least?

The HTML is as simple as:

<applet code="class_that_extends_Applet.class" archive="your_signed.jar"> <param name="param1" value="value1"> <param name="param2" value="value2"> </applet> 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.