English 中文(简体)
Java果特例:失踪<jnlp>
原标题:Creating a Java Applet exception: missing <jnlp> field

我的证人最后试图让我的 Java游戏在浏览器中工作。 我已成功地把网络开端应用程序投入运行,但将其转换成一个内部浏览器-窗口的仪表,正把我推向cra。

MYAPPLET.jnlp:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp href="MYAPPLET.jar" codebase="http://www.myDomain.com/directoryContainingJar/">
    <information>
        <title>Name</title>
        <vendor>----</vendor>
        <offline-allowed />
    </information>
    <resources>
        <j2se version="1.4+"
             href="http://java.sun.com/products/autodl/j2se" />
        <jar href="MYAPPLET.jar" main="true" />
    </resources>
    <applet-desc 
        name="Name"
        main-class="main.MainClass"
        width="700"
        height="600">
    </applet-desc>
</jnlp>

在我的档案中:

<applet width="700" height="600" code="main.MainClass">
     <param name="jnlp_href" value="MYAPPLET.jnlp">
</applet>

在上页时,我发现这一错误:

ExitException[ 3]MissingFieldException[ The following required field is missing from the launch file: <jnlp>]
    at sun.plugin2.applet.JNLP2Manager.redirectLaunchDesc(Unknown Source)
    at sun.plugin2.applet.JNLP2Manager.initialize(Unknown Source)
    at sun.plugin2.main.client.PluginMain.initManager(Unknown Source)
    at sun.plugin2.main.client.PluginMain.access$300(Unknown Source)
    at sun.plugin2.main.client.PluginMain$2.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Error while initializing manager: ExitException[ 3]MissingFieldException[ The following required field is missing from the launch file: <jnlp>], bail out

我改变了主要类别,以便其<代码>extends JApplet,而不是JFrame,但除了此以外,我不知道需要做些什么。

是的,我读到和谷歌。

最佳回答
问题回答

This appears to be a bug in JDK version 1.6 update 14: http://www.canoo.com/jira/browse/UBA-8105. What JDK are you using? Try with a JDK 1.7.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签