I wrote a 开发者_StackOverflow社区desktop application. It is about 35kb. Engine of the application is a soap service, and I used Apache Axis.
The problem is that with used library application becomes about 4 MB. I want to mention that the axis.jar is 1.5 MB.
Can anybody give me some advise to make sizes smaller? Can I replace axis.jar with another one? I am sure that in axis.jar I don't need all the classes.
You can use ProGuard to remove unnecessary classes in your jar. You'll need to configure it to be aware of entry points for your application. From there it usually does a good job of determining what you need, especially for a small program. See the examples for how to configure it for a variety of situations.
Java 6 has a web service stack built-in, which may be usable for you, so you only need to deploy your actual code (as the web service stack is part of the JRE).
If you need to use it with Java 5 you can download and use the Metro distribution of the same libraries from http://metro.java.net/, but that is a larger library than the Metro one. We have used that successfully for several projects where some customers needed to stay on Java 5.
精彩评论