Java小程序JNLP +库 [英] Java applet jnlp + libraries

查看:309
本文介绍了Java小程序JNLP +库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想补充库小程序。我使用的JNLP +部署Java的JavaScript。一切似乎是正确配置,芽类未找到(未找到类除外)。

I am trying to add libraries to applet. I am using the jnlp + deploy java javascript. Everything seems to be configured correctly, bud the classes are not found (class not found exception).

下面是我的code:

JNLP

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="." href="">
    <information>
        <title>KeystoreTestApplet</title>
        <vendor>Paulie</vendor>
    </information>
    <resources>
        <!-- Application Resources -->
        <j2se version="1.6+"
              href="http://java.sun.com/products/autodl/j2se"/>
        <jar href="KeystoreTestApplet.jar" main="true" />
        <jar href="xmlsec-1.4.5.jar" />
        <jar href="xml-apis-1.3.03.jar" />
        <jar href="xercesImpl-2.9.1.jar" />
        <jar href="xalan-2.7.1.jar" />
        <jar href="sunpkcs11.jar" />
        <jar href="serializer-2.7.1.jar" />
        <jar href="commons-logging-api-1.1.jar" />
        <jar href="commons-logging-1.1.jar" />
    </resources>
    <applet-desc 
         name="KeystoreTestApplet"
         main-class="KeystoreJApplet"
         width="600"
         height="370">
           <param name="MAYSCRIPT" value="true"/> 
     </applet-desc>
     <update check="background"/>
  <security>
    <all-permissions/>
  </security>       
</jnlp>

HTML

<script src="deployJava.js"></script>
<script>
    var attributes = { codebase:'.', code:'KeystoreJApplet', width:600, height:370} ;
    var parameters = {jnlp_href: 'KeystoreTestApplet.jnlp', mayscript: 'true'} ;
    deployJava.runApplet(attributes, parameters, '1.6');
</script>

小程序罐子,html页面和库罐子在同一目录下。

The applet jar, html page and the libraries jars are in the same directory.

感谢您的帮助。

推荐答案

我已经找到一点点不同部位的实际问题。

I have found the actual problem on a little bit different spot.

该库不从JNLP文件的路径包括在内,但在清单。清单路径已经被IDE作为LIB / {}库的.jar指定。所以Java在不同的目录搜索的罐子。

The libraries are not included from the paths in jnlp file, but in manifest. The manifest paths had been specified by IDE as lib/{library}.jar. So java was searching for the jars in a different directory.

这篇关于Java小程序JNLP +库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆