生成java JNLP 文件?
我有一个 java 应用程序,它读取包含一堆 .jar 文件的资源文件夹。对于其中一些 .jar 文件,必须根据默认架构创建相应的 JNLP 文件并将其存储在同一目录中。
是否有好的方法可以从 java 应用程序创建这些 JNLP 文件(并且可能将 .jar 文件中的一些数据添加到 jnlp 节点中)?
I have a java application that reads a resource folder containing a bunch of .jar files. For some of these .jar files corresponding JNLP files must be created based on default schema and stored in the same directory.
Are there good approach to create these JNLP file from a java application (and maybe add some data from the .jar files into jnlp nodes) ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它基本上是一个 XML 文件。任何 XML API 都可以做到这一点。就我个人而言,如果必须动态创建 JNLP 文件,我会使用 JAXB API。
It's basically an XML file. Any XML API could do it. Personnaly, I would go with the JAXB API if I had to create a JNLP file dynamically.
一个好的方法可能是从现有的 Ant-JNLP-War 任务开始。要么编写 Ant 脚本来执行您想要的操作,要么直接使用代码。
A good approach may be to start from the existing Ant-JNLP-War task. Either script Ant to do what you want, or make use of the code directly.