简体   繁体   中英

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

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

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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