我尝试用jnlp启动我的RCP项目。所以我实施了一个小型的e4-RCP项目。从产品开始不会造成任何问题。该应用程序应该工作正常。我安装了一台在localhost:8080上运行的tomcat服务器,这也开始得很好。比我为应用程序编写了一个 jnlp 文件。 导出并签名了 jar。当我尝试启动应用程序时,http://localhost:8080/webstart.jnlp 我得到异常:
java.lang.ClassNotFoundException: org.eclipse.equinox.launcher.WebStartMain
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at com.sun.jnlp.JNLPClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at de.checkpoint.webstart.WebstartLauncher.main(WebstartLauncher.java:9)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Thread.java:748)
说了这么多,这是我的主要内容:
软件包 de.checkpoint.webstart;
import org.eclipse.equinox.launcher.WebStartMain;
public class WebstartLauncher {
public static void main(String[] args) {
WebStartMain.main(args);
}
}
这是我的jnlp文件:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/" href="webstart.jnlp">
<information>
<title>Jnlp Webstart Test</title>
<vendor>Boris Nguema B.</vendor>
<homepage href="http://localhost:8080/" />
<description>Testing Webstart</description>
</information>
<security>
<all-permissions/>
</security>
<!-- <property name="eclipse.product" value="de.checkpoint.product"/> -->
<!-- <property name="osgi.frameworkParentClassloader" value="current"/> -->
<!-- <property name="jnlp.osgi.parentClassloader" value="current"/> -->
<resources>
<j2se version="1.8+" />
<jar href="de.checkpoint.start_1.0.0.201711041646.jar" />
</resources>
<application-desc main-class="de.checkpoint.webstart.WebstartLauncher" />
</jnlp>
谁能告诉我,我错过了什么?
我不确定您是否已经发现了问题,但是 equinox 启动器在清单中没有这些行:
权限:所有权限
代码库: *
仅受信任:真
您需要添加它们并签名。