Symbian
Symbian OS Library

FAQ-0883 My UIQ PersonalJava application fails with the message "Unable to initialize threads: cannot find class java/lang/Thread". Why is this?

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



 

Classification: Java Category: Emulator
Created: 06/12/2003 Modified: 07/14/2003
Number: FAQ-0883
Platform: Symbian OS v7.0

Question:
I'm trying to run a pJava application from the command line using the UIQ emulator. However my application always fails on launch with the message:
"Unable to initialize threads: cannot find class java/lang/Thread
Could not create the Java virtual machine"


Answer:
The Java Runtime Environment needs to be able to find the system classes contained in the classes.zip archive in order to launch successfully. The JRE system classpath includes ?:\Lib\classes.zip and therefore at launch the JRE will search the root of all available drives for the \Lib\classes.zip archive.

The UIQ SDK installation creates the following directory structure to classes.zip

\epoc32\java\Lib\classes.zip

To ensure the JRE successfully locates classes.zip it is necessary to map a virtual drive to the location of the Lib folder. This can be achieved by adding the following line to your \epoc32\data\epoc.ini file

_epoc_drive_j \epoc32\java



If you are developing your application in the \erj\examples\ folder you will also need to map a virtual drive to the erj folder. For example add the following line to epoc.ini

_epoc_drive_t \erj

Then for an application with a main class Hello, located in the \erj\examples\HelloWorld directory you would then launch the application from the command line as follows

%epocroot%epoc32\release\winscw\udeb\pjava_g -cp t:\examples\HelloWorld Hello