weird behavior when loading jar inside a jar in Java Web Start

流过昼夜 提交于 2020-01-14 04:15:28

问题


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.

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


回答1:


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 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.

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!



来源:https://stackoverflow.com/questions/10021715/weird-behavior-when-loading-jar-inside-a-jar-in-java-web-start

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!