首次在 Ubuntu 中使用 Java Web Start - 致命启动异常

首次在 Ubuntu 中使用 Java Web Start - 致命启动异常

我已经使用 Ubuntu 一段时间了,Java Web Start 应用程序在当前版本或任何以前的版本中都从未“正常工作”,所以我一直忽略它们,直到现在。但是,现在我需要让它们在 Firefox 中工作。当我在这样的页面上时:http://www.oracle.com/technetwork/java/demos-nojavascript-137100.html 我希望能够按照建议单击演示并运行它们。

我正在运行带有 Gnome 3 的 Ubuntu 11.10 和/或带有 OpenJDK 6、OpenJDK 7 和 Sun Java 6 的 Linux Mint 12(64 位)。我的默认设置当前为:/usr/lib/jvm/java-6-openjdk/jre/bin/java

$ whereis javaws
javaws: /usr/bin/javaws

/etc/alternatives/javaws->/usr/lib/jvm/java-6-openjdk/jre/bin/javaws

这是我尝试运行 Java Web Start 应用程序时收到的错误:

net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: Could not initialize application.
    at net.sourceforge.jnlp.Launcher.createApplication(Launcher.java:776)
    at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:552)
    at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:887)
Caused by: net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: A fatal error occurred while trying to verify jars.
    at net.sourceforge.jnlp.runtime.JNLPClassLoader.initializeResources(JNLPClassLoader.java:448)
    at net.sourceforge.jnlp.runtime.JNLPClassLoader.<init>(JNLPClassLoader.java:176)
    at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:295)
    at net.sourceforge.jnlp.Launcher.createApplication(Launcher.java:767)
    ... 2 more
Caused by: 
net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: A fatal error occurred while trying to verify jars.
    at net.sourceforge.jnlp.runtime.JNLPClassLoader.initializeResources(JNLPClassLoader.java:448)
    at net.sourceforge.jnlp.runtime.JNLPClassLoader.<init>(JNLPClassLoader.java:176)
    at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:295)
    at net.sourceforge.jnlp.Launcher.createApplication(Launcher.java:767)
    at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:552)
    at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:887)

这是另一个例子:

http://docs.oracle.com/javase/tutorial/uiswing/events/keylistener.html

net.sourceforge.jnlp.LaunchException: Fatal: Read Error: Could not read or parse the JNLP file.
    at net.sourceforge.jnlp.Launcher.fromUrl(Launcher.java:491)
    at net.sourceforge.jnlp.Launcher.launch(Launcher.java:283)
    at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:199)
    at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:51)
    at java.security.AccessController.doPrivileged(Native Method)
    at net.sourceforge.jnlp.runtime.Boot.main(Boot.java:165)
Caused by: java.io.IOException: port out of range:-2147483648
    at net.sourceforge.jnlp.JNLPFile.openURL(JNLPFile.java:255)
    at net.sourceforge.jnlp.JNLPFile.<init>(JNLPFile.java:185)
    at net.sourceforge.jnlp.JNLPFile.<init>(JNLPFile.java:162)
    at net.sourceforge.jnlp.JNLPFile.<init>(JNLPFile.java:148)
    at net.sourceforge.jnlp.Launcher.fromUrl(Launcher.java:477)
    ... 5 more
Caused by: 
java.io.IOException: port out of range:-2147483648
    at net.sourceforge.jnlp.JNLPFile.openURL(JNLPFile.java:255)
    at net.sourceforge.jnlp.JNLPFile.<init>(JNLPFile.java:185)
    at net.sourceforge.jnlp.JNLPFile.<init>(JNLPFile.java:162)
    at net.sourceforge.jnlp.JNLPFile.<init>(JNLPFile.java:148)
    at net.sourceforge.jnlp.Launcher.fromUrl(Launcher.java:477)
    at net.sourceforge.jnlp.Launcher.launch(Launcher.java:283)
    at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:199)
    at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:51)
    at java.security.AccessController.doPrivileged(Native Method)
    at net.sourceforge.jnlp.runtime.Boot.main(Boot.java:165)

答案1

已解决:显然 Sun Java javaws 可以工作。在 Firefox 中:

编辑 > 首选项 > 应用程序 > “Java Web Start 应用程序” > 其他:

/usr/lib/jvm/java-6-sun/jre/bin/javaws

相关内容