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