JAR 文件中的 Java 小程序 [英] Java Applet in JAR File
问题描述
我创建了一个 java 小程序(.class 文件)并用它制作了一个 .jar 并对 .jar 文件进行了数字签名.现在我需要在 Firefox 中将 .jar 作为小程序运行.我应该在 html 代码中放入什么来将 .jar 文件作为小程序运行?我试过了,但它不起作用,它试图获取一个 .class 文件,如何使用 Internet Explorer 和 Firefox 中的小程序标记将我的小程序作为 .jar 文件加载和运行?我在互联网上搜索,找不到答案.
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.
推荐答案
http://java.sun.com/docs/books/tutorial/deployment/jar/run.html
应该可以
<applet code=TicTacToe.class
archive="TicTacToe.jar"
width=120 height=120>
</applet>
(我假设这个类有你的 main(),jar 就是整个东西)
(The class has your main() I assume, the jar is the entire thing)
这篇关于JAR 文件中的 Java 小程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!