简体   繁体   English

使用Java Web Start远程部署项目

[英]Deploying a project remotely using Java Web Start

I am trying to deploy a project remotely using Java web start. 我正在尝试使用Java Web start远程部署项目。 Here it is working for a single jar file. 这里它适用于单个jar文件。 Can anyone tell me how to deploy this for multiple jar files and as I am using SQLite DB which uses sqlite-jni.dll for its execution on windows? 任何人都可以告诉我如何为多个jar文件部署它,因为我使用SQLite DB使用sqlite-jni.dll在Windows上执行? I need to include this file to in the JNLP. 我需要将此文件包含在JNLP中。

Any kind of help will be appreciated. 任何形式的帮助将不胜感激。

Thanks in advance. 提前致谢。

Put the native in the root of a signed Jar file and add it to a nativelib element in the JNLP. 将本机放在已签名的Jar文件的根目录中,并将其添加到JNLP中的nativelib元素。 Since it is a DLL, make sure you add it to a Windows specific resources section. 由于它是DLL,请确保将其添加到Windows特定resources部分。

Do you have natives for Mac. 你有Mac的本地人吗? and *nix? 和*尼克斯?


EG 例如

<?xml version='1.0' encoding='UTF-8' ?>
<jnlp spec='1.0' codebase='http://our.com/lib/' href='our.jnlp'>
    <information>
        <title>Our App.</title>
        <vendor>our.com</vendor>
    </information>
    <security>
        <all-permissions />
    </security>
    <resources>
        <j2se version='1.5+' />
        <jar href='our.jar' main='true' />
        <jar href='sqlite.jar' />
    </resources>
    <!-- Supply the DLL only to windows -->
    <resources os='Windows' >
        <nativelib href='sqlite-jni-windows.jar' />
    </resources>
    <application-desc main-class='com.our.Main' />
</jnlp>

In this example, all resources should be located in http://our.com/lib/ . 在此示例中,所有资源都应位于http://our.com/lib/

The native (in this case a DLL) should always be in the root of the Jar file. 本机(在本例中为DLL)应始终位于Jar文件的根目录中。


I also offer JaNeLA which checks the validaty of JNLP files & performs sanity checks on many other aspects of JWS based launches. 我还提供JaNeLA ,它检查JNLP文件的有效性,并对基于JWS的启动的许多其他方面进行健全性检查。

In our case, we specify all the files needed (jar and zip wise) in our jnlp file. 在我们的例子中,我们在jnlp文件中指定了所需的所有文件(jar和zip)。 We have used .dll's but they were packaged with a program that was already installed on the system. 我们使用过.dll,但它们与已经安装在系统上的程序打包在一起。 We interacted with this program via ours. 我们通过我们与该计划进行了互动。 All we needed was to make sure the path to the .dll's was specified in the Windows path variable. 我们所需要的只是确保在Windows路径变量中指定.dll的路径。

In terms of packaging, we packaged all our jars into a .war file and then put that .war into an .ear file (not necessary, but we did) and deployed that to our application server. 在打包方面,我们将所有jar包装成.war文件,然后将.war放入.ear文件中(不是必需的,但我们做了)并将其部署到我们的应用程序服务器。 When we updated the jar versions in our war, we also updated the jar version numbers in our .jnlp file (as well as in some version.xml file we use) and redeploy it all. 当我们在战争中更新jar版本时,我们还更新了.jnlp文件中的jar版本号(以及我们使用的一些version.xml文件中)并重新部署它们。 Then when the client's fire up, they check against the new .jnlp file and download the right jars. 然后当客户端启动时,他们会检查新的.jnlp文件并下载正确的jar。

Is that helpful? 这有用吗? Did I understand your question correctly? 我是否正确理解了您的问题?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM