简体   繁体   English

当主jar依赖于其他文件时使用Java Web Start

[英]Using Java Web Start when main jar depends on other files

I have recently completed a java program and Im now looking into options for deploying it. 我最近完成了一个Java程序,我现在正在研究用于部署它的选项。 I was introduced today to Java Web Start. 今天向我介绍了Java Web Start。 My problem is the following: my program contains the main executable jar, a lib folder that contains the libraries which my program uses, and a couple of other folders which contain files that my program reads from and writes to. 我的问题如下:我的程序包含主要的可执行jar,一个lib文件夹,包含我的程序使用的库,以及两个其他文件夹,它们包含我的程序读取和写入的文件。 Is it possible to use Java Web Start with such a structure? 是否可以通过这种结构使用Java Web Start? All the examples I have seen on the web were simple programs made up of just one jar. 我在网上看到的所有示例都是仅由一个jar组成的简单程序。 Thanks. 谢谢。

The extra libraries are no problem. 额外的库没问题。 Just add a reference to each one in the JNLP resources section. 只需在JNLP resources部分添加对每个引用。

The 'loose files' are, slightly, in that loose resources cannot be referenced in a JNLP and archives are not writable. 略微的“松散文件”在于,在JNLP中无法引用松散的资源,并且归档不可写。 But even that is fixable. 但这甚至是可以解决的。 See the accepted answer to How can an app use files inside the JAR for read and write? 请参阅有关应用程序如何使用JAR中的文件进行读写的公认答案

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

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