在Java Web Start中将jar加载到jar内时会出现奇怪的行为 [英] weird behavior when loading jar inside a jar in Java Web Start

查看:200
本文介绍了在Java Web Start中将jar加载到jar内时会出现奇怪的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hell All,
所以我已经面临这样的行为了很长一段时间,我相信有些人也面临着这个问题,并且知道解决方案。我正在使用eclipse导出我的应用程序jar作为一个可运行的jar,显然这个应用程序有很多其他jar,所以我正在导出与main jar中的选项打包其他jar。问题是当我启动我的应用程序,它没有加载文件从db2jcc.jar和几个其他jar,但如果我部署db2jcc.jar作为单独的jar应用程序运行正常。

Hell All, So I have been facing this behavior for quite some time and I am sure some else has also faced it and know the solution. I am exporting my application jar as a runnable jar using eclipse and obviously this application have many other jar and so I am exporting with option packed other jar inside the main jar. The problem is when I am starting my application it is not loading the file from db2jcc.jar and few other jar but If I deploy db2jcc.jar as separate jar application running fine.

所有我想保留我的jnlp文件和jar进程签名简单尽可能的,这就是为什么我把jar放在主jar中。非常感谢您的建议。我正在使用Rational Software Architect 8.0(基于eclipse)导出

All I want to keep my jnlp file and signing of jar process as simple as possible, that is why I am including jar in main jar. Thanks very much for your suggestion. I am using Rational Software Architect 8.0( based on eclipse ) for export

推荐答案

我不认为这是一个好主意你的主jar文件中的依赖(其他jar文件)。也许有办法做这个工作,但是有一个很好的理由不这样做:缓存

I don't think it's a good idea to include the dependencies (other jar files) inside your main jar file. Maybe there is a way to make that work, but there is a good reason not to do that: caching.

Java Web Start缓存jar客户端计算机上的文件。因此,通过将它们与应用程序jar保持分离,每次更新应用程序时,Java Web Start不必再重新下载它们。您的屏幕截图显示您有超过12MB的依赖关系,所以这样做是让人们每次都下载的。

Java Web Start caches jar files on the client computer. So by keeping them separate from your application jar, Java Web Start doesn't have to download them all over again each time you update your application. Your screenshot shows that you have more than 12MB of dependencies, so that's a lot to make people download every time.

如果您担心使签名过程变得简单然后只要写一个脚本来为你做。实际上,我在屏幕截图中注意到向导会为你创建一个Ant脚本。我建议您让它为您创建Ant脚本,然后再运行该脚本 - 它应该比每次执行向导更简单和更快!

If you're worried about making the signing process a simple as possible, then just write a script to do it for you. In fact, I notice in the screenshot that the wizard will create an Ant script for you. I suggest that you get it to create the Ant script for you, then just run that script instead — it should be simpler and faster than stepping through a wizard each time!

这篇关于在Java Web Start中将jar加载到jar内时会出现奇怪的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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