Download CDC Build System Guide
Transcript
4.4.4 Adding Classes to Preloaded Builds Product-specific classes can be added to the list of preloaded classes. This feature can be used for bundled applications and product-specific class libraries. Because the preloaded classes are linked to the bin/cvm executable at build time, this process cannot be undone at a later stage to regain space. Here’s an example of how to add an application class file to the list of preloaded classes: 1. Compile the Java application. % javac HelloWorld.java 2. Edit build/linux-x86-suse/GNUmakefile and modify the definition of CVM_JCC_INPUT to include the compile Java application: CVM_JCC_INPUT += myclasses/HelloWorld.class CVM_JCC_INPUT specifies the list of preloaded classes. The += syntax is necessary to avoid overriding the values defined in share/jcc.mk. 3. Build the CDC Java runtime environment with preloading enabled. % make By itself, this technique will preload only those classes appended to CVM_JCC_INPUT. To preload the full Java class library, use CVM_PRELOAD_SET= libfull. In this example, it is not necessary to define the class search path for HelloWorld with the -cp command-line option at runtime because the class has been preloaded. The difference in size between the cvm executable is not great because HelloWorld is a small class. The benefits of faster launching and operation are more apparent with larger applications. 4-10 CDC Build System Guide • December 2008