Symbian
Symbian OS Library

FAQ-0319 Why aren't all the core Java classes in classes.zip?

[Index][spacer] [Previous] [Next]



 

Classification: Java Category: General
Created: 10/14/99 Modified: 06/22/2001
Number: FAQ-0319
Platform: Not Applicable

Question:
I have been trying to use 100% Java compilation tools to compile Java classes on a netBook but they fail to find some core classes like java.lang.Object which are not in classes.zip. Why are they absent and how does the EPOC Runtime for Java function without them?

Answer:
When a Java class is loaded, the VM reads the corresponding bytecode into memory and adds it to the set of currently loaded Java classes. (This involves updating various companion data structures, resolving references to other classes, etc.)
In the MARM implementation of the Symbian Runtime for Java, a number of core Java classes (including java.lang.Object) have been "pre-loaded", i.e. the data structures resulting from loading the classes have been incorporated into the main DLL of the Symbian Runtime for Java (called javai.dll). This was done to facilitate more rapid launching of the VM by eliminating the time taken to interpret these fixed classes; it also reduces the RAM footprint of the Symbian Runtime for Java because many of the data structures are read-only and hence suitable for use directly from ROM.

Unfortunately Java compiler tools running on the Symbian Runtime for Java need to make reference to a full set of compiled Java classes and are unable to find the pre-loaded ones.

A workaround which may solve this problem is to take the full version of classes.zip supplied with the WINS emulator on the relevant Symbian SDK for Java, compress it (e.g. by extracting and re-archiving using winZip) and replace the version on the Symbian device. You may additionally want to remove language-specific resources (under java.text.resources) which you do not expect to have need of to save space, as the unedited compressed version still takes up 3.7MB.