Before installation of the kAWT specific files, you have to obtain a copy of SUNs J2ME Connected Limited Device Configuration Version 1.0, which can be downloaded from the following URL: http://www.sun.com/software/communitysource/j2me/. We recommend to deflate the zipfiles to drive C: of a Windows machine into the directory "j2me_cldc". The Palm binaries
|Figure 1||Figure 2||Figure 3|
At this point you are able to run all SUN example applications that are shipping in the J2ME CLDC Reference implementation. But in order to run kAWT applications you need to install additional classes to the KVM. If you will try to run e.g. the KawtDemo application from our "Samples and Screenshot" section without these classes you will get the following results after the application file "KawtDemo.prc" is installed and executed on the Palm:
|Figure 4||Figure 5|
In figure 4 the KawtDemo application is installed via drag'n'drop like the KVM in the first step as well. After starting the application the KVM will popup a dialog show in figure 5, that the class java.awt.Frame can not be found. This is an indicator for a lacking kAWT installation. To solve this problem we will describe how to choose the appropriate pdb file and how to install it on POSE.
Currently we distribute three of the above mentioned pdb files, which are stored in zip files:
The first pdb-file (kawt.pdb zipped in kawt_pdb.zip) is for users that are interested in kAWT development without our file emulation and java.net.Socket wrapper. The second pdb-file (io_net.pdb zipped in io_net_pdb.zip) includes the additional java.io and java.net classes only. We recommend to install the file kawt_io_net.pdb including all kAWT classes. So we install that file by draging it into the emulator right now.
|Figure 6||Figure 7|
In figure 6, you can see the installed KVM, the KVMutil and the KawtDemo once more, and in figure 7 the running KawtDemo after installation of the additionally needed kAWT classes.
In the installation section, we decribed how to install the kAWT on a Palm device or on POSE and how to run the KawtDemo.prc file. In this section we will explain how to use kAWT and the J2ME CLDC SDK to build the KawtDemo. For J2ME Development it is necessary to have a JDK1.2 or higher installed, because the J2ME CLDC SDK isn't shipping a java compiler. You have to use the java compiler of the J2SE for compilation. The additinally needed preverifier is part of the J2ME SDK and can be found in directory "C:\j2me_cldc\bin".
The first step is to download the preverified kAWT classes that are included in the file kawt_io_net.zip from our Download section. Unzip the file and copy the whole directories de, java and javax into the directory C:\j2me_cldc\bin\api\classes
Now you have to download the source of KawtDemo from our Samples and Screenshots section into a working directory e.g. C:\temp. To compile the KawtDemo sourcefile you have to use the following commandline:
javac -bootclasspath C:\j2me_cldc\bin\api\classes KawtDemo.javaIf you look into your working directory you will see some new class files like:
For debugging prposes, you can run the application on desktop java using the following command (to be used in the working directory)
java KawtDemoand you will get see a window similar to the screenshot in figure 8.
To get a Palm executable, which can be run on a Palm device using the KVM we habe to preverify and build a prc-file now. The preverification is done usint the following commandline. In our working directory we will find an additional directory called "output" containing the preverified classfiles.
C:\j2me_cldc\bin\preverify -classpath .;C:\j2me_cldc\bin\api\classes .You can test application using SUNs "KVM/Palm Emulator" on the desktop using the following command in the output directory:
C:\j2me_cldc\bin\kvm -classpath .;C:\j2me_cldc\bin\api\classes KawtDemoand you can see screenshot as in figure 9.
The last step to create the prc-files from the preverified classes using the java-tool MakePalmApp. This SDK-tool is entirely written in java and can be found in the directory C:\j2me_cldc\tools\palm\src\palm\database. These files are not compiled yet, so before we can build a prc files using these tools we have to compile them. The compilation is done using the command
javac. *.javain the directoryC:\j2me_cldc\tools\palm\src\palm\database. Please ignore the deprecation warning. In order to build the prc file, please change output directory of your working directory and use the following command to build a Palm executable
java -classpath C:\j2me_cldc\tools\palm\src palm.database.MakePalmApp -bootclasspath .;C:\j2me_cldc\bin\api\classes KawtDemo Closer MiscPanel LayoutPanel ScrollbarPanel
Resulting you will find a KawtDemo.prc file in the output directory that can be installed on POSE and a real Palm, too..