Reputation: 116412
I've made a small util that can run on Windows OS (and probably others), using SWT , WindowsBuilder, and Eclipse as IDE.
The app is supposed to help developers to minimize their Android app's size, by converting images into WebP/Jpeg when possible. It's available here.
I wanted to make it easier for people to run it, so I've called "export as runnable jar".
Once I did this, I've noticed that from an app that takes just a few MB (needs SWT and an exe converter file), it got to be more than 20MB of storage.
Looking at the files structure, I've found this:
The export wizard only has 2 steps: choosing to export as a runnable jar, and this one:
So I can't find out how to configure it. I tried to change the running-configuration, but it fails to run if I remove the additional jars:
Error: Could not find or load main class webpifier.Main
Choosing to restore the default entries, I get the additional jars:
How could this be? Are all those jars needed? Is it possible to avoid having such a large chunk of added files? What is the purpose of those files?
For other OSs, will replacing just the SWT file (and the converter file) be enough so that the app will run? Or should I call the "export as runnable jar" on the other OSs too (this is Java, so why should I?) ?
Upvotes: 2
Views: 338
Reputation: 3518
I'll post my comment as answer:
How could this be? Are all those jars needed?
Only you know, if all jar's are really needed.
All JAR's which are referenced to the project are normally also copied to the distribution-folder (also unused JAR's).
Further: When you're using Eclipse-RCP or SWT, all needed Eclipse/SWT-JAR's are also copied to the distribution-folder!
I suggest using Swing instead of SWT.
Swing is already included in Java-Libs, but SWT not.
So you don't need to distribute all those SWT-JAR's.
TIP:
To reduce the distribution size of your application, try to get rid of all: org.eclipse.*
-Imports
For some more important info's regarding SWT vs Swing, see here:
Java Desktop application: SWT vs. Swing
Upvotes: 2