Main Page
    Cookbook/Overview     ImageMeister     the jcprops file     Licensing
    Binary Installation & Configuration [ Win · Mac · Nix · OSX ]     Changes
    Public API
    Source Code Main Page
        Java [ Common · Win · Mac · Nix ]     Native Code [ Common · Win · Mac · Nix ]     Manifest
        Native Code Overviews [ Common · Win · Mac · Nix · Strings ]     Macros [ General · Native Macros ]
        Walkthroughs [ Java only · Java and native ]     Building [ Win · Mac · Nix · OSX ]     Distribution Issues

Minimizing the Redistribution Size

This file describes how to reduce the size of the files that you're going to distribute to end users.

Minimizing JConfig.zip

You can remove packages from JConfig.zip if you aren't using them. However, some parts of the Java code are loaded dynamically, so you must be careful.

The .class files in the com\tolstoy\testjc subdirectory inside JConfig.zip are only used for testing purposes. Unless you're using them elsewhere, they can be removed

If you are providing separate distributions for each platform, you can remove the JConfig implementation classes used for platforms other than those that your distribution is designed to run on.

For instance, if your distribution is only designed to run on Windows, you can remove the .class files in the com\jconfig\nix and com\jconfig\mac subdirectories inside JConfig.zip.

Minimizing JConfig.shlb

This shared library actually consists of three shared libraries, not all of which might be needed for your distribution.

See the 'Compiling' section in macinstall.html for more information.

Minimizing the Number of the Windows DLLs

The six DLLs are specific to the following VMs:
Windows95/98 WindowsNT
Sun VM 1.1 or greater     jcnfigSN.dll jcnfigSW.dll
MSVM1.5 jcnfigMS.dll jcnfigMW.dll
MSVM 2 or greater jcnfigM2.dll jcnfig2W.dll

For instance, jcnfigSN.dll is only used with the Sun VM, and only on Win95 or 98.

You only need to ship the DLLs with which your application will be run. If you allow the user to select which VM they're going to run your app with, then you might need to ship all the DLLs. However, if you specify, for instance, that your app can only be run with later versions of the MSVM and only on Windows 95 or 98, then you only need to ship jcnfigM2.dll.

The RNI specification was changed with the introduction of the MSVM SDK 2.0. The original version is shown above as MSVM1.5; the newer version is shown as "MSVM2 or greater".

This appears to correspond to Build 4.79.2174 of the MSVM, from approximately 7/97. So, if your distribution will only be used on versions of the MSVM which were produced after that Build, you do not need the two MSVM1.5 DLLs. You may even be able to run the MSVM2 DLLs with versions of the MSVM prior to that Build, but this hasn't been tested.

If you aren't running with the Sun VM, then you don't need the two SunJDK DLLs.

Another alternative is to modify the .java files to always load either jcnfigSN or jcnfigSW. That would limit you to running on either the Sun VM, or on the latest versions of the MSVM, which include JNI support. That has not been tested however.

If you aren't going to run on Windows NT, you don't need the DLLs so marked, and vice versa for Win95/98.

For more information, see this chart on MSVM versioning.

Minimizing the Size of the Windows DLLs

The LINK_OUT_??? defines at the beginning of sehstubs.cpp allow you to selectively remove parts of the native code. When those parts are removed and the DLL is relinked, the linker will usually make a smaller DLL which doesn't include the unwanted code.

For instance, if you add the following line to the beginning of sehstubs.cpp:

#define		LINK_OUT_nativeCreateVolumeAlias
the functionality associated with creating an alias for a volume will be removed. If this native method is called by the .java code, it will just return -1.

IMPORTANT NOTE: ONLY USE THIS IF ABSOLUTELY NECESSARY
This feature has not been thoroughly tested, and the difference is only between an approximately 100k DLL and one that's 50 or 60k. If you use this, be sure to test your application thoroughly.

Custom solutions

It might be possible to minimize the distribution size even further by removing even more .java or .cpp code that discussed above. However, this is highly app-specific.



Main Page · JConfig · ImageMeister · System Properties Repository · WordMeister · Free Samples · Java Freeware · Contact Us · FAQ · Links


Copyright (c) 1997-2002 Samizdat Productions. All Rights Reserved.
WarpMovie, TileMovie, JConfig, ImageMeister and MovieShredder are Trademarks of Samizdat Productions.