我有一個jsp頁面爲:使用JNLP文件啓動一個應用程序
<html>
<head>
<title>Try in JNLP</title>
<script src="http://www.java.com/js/deployJava.js"></script>
<script>
var dir = location.href.substring(0, location.href.lastIndexOf('/')+1);
var url = dir + "try.jnlp";
deployJava.createWebStartLaunchButton(url, '1.6.0');
</script>
<noscript>JavaScript is required for this page.</noscript>
</head>
<body>
</body>
</html>
,並有一個JNLP文件:
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/try/" href="try.jnlp">
<information>
<title>TRY JNLP</title>
<vendor>TRY JNLP</vendor>
</information>
<resources>
<!-- Application Resources -->
<jar href="TryJNLP.jar" main="true" />
</resources>
<application-desc name="Try JNLP" main-class="tryjnlp.TRYJNLPApp">
</application-desc>
<update check="background"/>
</jnlp>
所有的罐子都在各自的目錄,但是當我雙擊該jnlp文件告訴我一個錯誤說:
java.lang.NoClassDefFoundError: org/jdesktop/application/SingleFrameApplication
與其完整的錯誤堆棧。
如果我只是通過雙擊運行我的swing應用程序(TryJNLP.jar),它就可以完美運行。
請幫幫我。
@Ankur:請列出'在各自目錄中'的jar文件夾,以及目錄所在的jar文件和META-INF/context.xml文件的內容 –
Jar名稱與上面提到的相同:** TryJNLP.jar * *和它的MANIFEST.MF文件是 '清單-版本:1.0 創建-通過:1.6.0_23(Sun微系統公司) 閃屏-圖片:資源/圖像/ splash.png 主類:SwingSet2' 一個更多的事情(我的壞)我改變了.jnlp文件的主類屬性也SwingSet2' 即使發生異常 ** java.lang.ClassNotFoundException:SwingSet2 ** –
JNLP文件無效。使用[JaNeLA](http://pscode.org/janela/)進行檢查。 –