本主题已以一种形式介绍或其他形式,但其他线程都没有能够提供帮助。我的问题与这篇文章非常相似,我正在制作一个带有额外的功能的Jung图表,但没有一个解决方案有助于:

japplet在html页面 中运行

我有一个我转换为japplet的Java应用程序。 jappleet在Eclipse的Applet Viewer中工作很好,但是当我尝试在网页中打开它时,不起作用(我尝试了IE,Firefox和Chrome)。我有我的HTML页面和归档文件夹,都在同一目录中。当我加载HTML页面时,它只会带来任何东西。

这是我的html代码:

<html>
<title>Applet</title>
<head>

</head>
<body>

<applet code="prerna.blueprint.main.BPTester.class" 
        archive="applet1.jar"
        width="800" height="800">
</applet>

</body>
</html>
.

当我尝试有代码=“bpterster.class”它给java.lang.classnotfoundException:bpterster.class但是当我使用代码=“pranna.blueprint.main.bptiester.class”时,它没有任何错误发生。 (pranna / blueprint / main / bpterster.class是我的src文件夹中的文件路径)。我将我的Java项目导出为一个可追踪jar文件,这是正确的吗?我创建了一个简单的japplet,当我做了所有相同的步骤时,它会罚款,但它不适用于bpterster.class。

如果我需要发布我的bpterster.class代码。

我不明白为什么我无法在网页中查看japplet,任何帮助都非常感谢。

有帮助吗?

解决方案

What ended up working for me was adding every single jar I used in the japplet to the HTML archive tag then had to sign every jar. I then had an issue with accessing my database within the applet1.jar so I just put an absolute path for its location.

其他提示

java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read)

The applet needs to be digitally signed (by you) and trusted (by the end user, when prompted) before it can obtain such information. Given this applet is being deployed using a traditional applet element (i.e. not using web start), all jars need to be signed.

You need to sign every jar. You can sign all the jars with the jarsigner utility. Example:

jarsigner.exe "nameofthejar.jar" "alias"

Remove .class from the end. You either use a file path with slashes and .class at the end or you only use periods and no .class at the end.

Try turning on tracing in the java control panel. It will then produce a log file in the following path that may help: %USERPROFILE%\AppData\LocalLow\sun\java\Deployment\log

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top