J2ME Personal Profile was released
in 2002 and one of the features of Sharp Zaurus also released at that time,
so-called "Linux Zaurus" or "World wide Zaurus".
The released reference implementation of Personal Profile(PP), version 1.0,
was only available in extremely limited environment as Red Hat Linux 7.2. The
distributed product was CUI based environment, but I introduce it into NetBeans
3.6 projects and got a convenient environment for emulating Zaurus-Java on PC,
where I could use cvm or Xlet by mouse clicking.
To my (our?) regret, PP-RI is left for more than two years, without any improvement at that time. But Zaurus-Java is still very hot in the world! So I made an English version of a report I wrote in Japanese. I hope people of Sun (and Sharp?) would find this and get interested in PP-RI again...
November 26, 2004
The version of Red Hat Linux used was 7.2, just as recommended. I got it from CD added with the Japanese Magazine UNIX USER (Softbank Publishing Ltd.)
First, J2SDK should be installed. I located an unpacked product of selc-extracting file as /usr/j2sdk1.4.1, and then made its symbolic link /usr/java..
Notice that ksh is required to setting up PP-RI. Ksh might not be installed as default on installing RHL7.2. I found it in 2nd CD of two, distributed with UNIX USER. I used GNORPM to find and install the rpm of pdksh-5.2.14-13, a famous clone of ksh.
Then, Personal Profile. It's
distributed at
http://wwws.sun.com/software/communitysource/j2me/pp/download.html
Unpacking the zip file resulted in a directory "personal". I located this as /home/noniko/personal.
The Document is required, I think. Otherwise we would be at a complete loss what to do....
Beware not to unpack this zip file in an important directory, or the files would be scattered. I did it just under my home directory. I had to made "ppdoc" directory and pick up all the scatterd files into is by drag'n'drop.
PP-release-notes.html includes
how to setup PP-RI.
PP_Programmer_Guide.pdf includes how to run demos.
I edited my .bash_profile file to set environment valuables as follows:
PATH=$PATH:$HOME/bin:/usr/java/bin:$HOME/personal/build/linux-i686/bin
export PATH
JAVA_HOME=/usr/java
export JAVA_HOME
The executable file cvm was located somewhat deep in lower part of the directory structure, so I made a symbolic link:
In this /home/noniko/personal/build/linux-i686 directory I created a script named buildpp like this:
#!/bin/bash
make J2ME_CLASSLIB=personal JDK_HOME=/usr/java \
CVM_GNU_TOOLS_PATH=/usr/bin J2ME_BUILD_STATUS=fcs \
CVM_DEBUG=true CVM_JVMDI=true CVM_SYMBOLS=true
(It's a description two years ago and now I have no environment to run RHL7.2 to make sure...the script should be written as #!/bin/ksh in fact but I made a mistake in this report? Or is it OK with thecommand $ksh buildpp ? Sorry, I can't remember, please try it by yourself.)
The script is somewhat complicated
and, of course, a mistake of description causes fatal error. This was run on
DELL Optiplex GX50 with 900MHz Celeron and took minutes. There were no message
of completion, only next propt character appeared to show it.
Before introducing this PP-RI into NetBeans, I tested whether it works by itself. The working directory was /home/noniko/personal/build/linux-i686, or a symbolic link, /home/noniko/pp.
The first demo.
$cd democlasses
$cvm HelloWorld

Can you beleve the above screenshot is for full screen of 1200x 768? A large Hello-World window! It's an AWT window which works both by cvm and java.
An Xlet demo, specifig to cvm, was also successful by a command from the directory democlasses:
The result was a famous triagle-shaped chap with red'n' round nose and black'n'white body appearing in a frame window. The image will shown as a result of NetBeans' project later.
Now that cvm works by itself, Then use NetBeans3.5.1. It was installed in /home/noniko/NB351.
I made a new project for usage of PP-PI.. Selecting "Project"->"Project Manager", clicking"New..." button of thesetting window, and settingt the name of the project "PP", I got the new project "Project PP".
The new project has no filesystem
mounted. I created a new directory /home/noniko/pp/nonipp and mounted
it:
Selecting "File"->"Mount Filesystem"->"Local
Directory", the filechosser appears to select the above directory graphically.
It is not bad idea to mount the democlasses directory and try to run demo again, this time by operations in NetBeans.
For setting classpath, in the case NetBeans 3.5.1( to 3.6) ,you have only to mount jars or zips.
"File"->"Mount
Filesystem"->"Archive Files" and then you can select required
archives from the file chooser.
Remember /home/noniko/pp is a symbolic link of /home/noniko/personal/build/linux-i686.
/home/noniko/pp/lib/personal.jar
/home/noniko/pp/democlasses.zip
/home/noniko/pp/btclasses.zip(Really required? I don't know)
/home/noniko/pp/testclasses.zip(ditto)
Some archives might not be needed, but no harm if mounted together.

The above Explorer window was after creating a few of my applications. The node with too long name to show completely is for democlasses directory mounted, holding a long tree of demo classes.
To use cvm in NetBeans, select "Tools"->"Options", find the node"Execution Types", right-click it and select "New"B
Select "New".
The dialog window with a field appears to give a name to the new Execution. I set it as "cvmappExecution".
Sorry above is a screenshot after perfect settng, so you already see "XletExecution" and "cvmappExecution" I have made. for further setting, select "cvmappExecution" node to show properties list at the right side of the option window.
![]()
The above is a focused part of the properties list for "cvmappExecution" when it was created. The value of "External Process" is, by default, for execution of java of j2sdk1.4.2. Click the "..."button next to the field "Process" and you will get a wide "External Process" setting window.

The above is the default setting of "External Process", for running java of J2SE. There is an explanation of "Argument Key". Let's follow it to edit Process and Argument for running cvm of PP-RI:

The value of Process is the path
to executable file cvm. You can choose it graphically by clicking "..."
button at the right side.
The value of Arguments I had to edit manually. Sorry a little hard to see but
note that there is no space among the three brackets {filesystems}{:}{classpath},
but there is one before {classname} and also before {arguments}.
Test the new Execution by using "HelloWorld"
Frame demo. Go to the "Filesystems" window, open the "democlasses"
node mouted and select the subnode"HelloWorld", right-click it and
select "Properties".
The properties window of Helloworld.class appears, so click the tab "Execution".
The value of "Executor" is by default "External Execution".
Clicking the cell of the value, a list of available execution appears. Select
"cvmExecution"

Oh, I took a screeenshot after XletExecution(and
with a wrong spell) was selected. Anyway select "cvmExecution".
Then return to the "Filesystems" window. Select he node HelloWorld
(or it's already selected) and click the green-triangle-iconed execution button
of tool bar, or right-click the HelloWorld node and select "Execute"...You
will see the big AWT window of "Hello World" again!
Let's make a simplest application,
simpler than the big Hello World window above, outputting a message to the console,
but using cvm for execution.
Just as for an ordinary Java application, under the mounted node /home/noniko/pp/nonipp I created a new package test and a simple class file Hello:
package test;
public class Hello {
public static void main(String[] args){
System.out.println("Hello");
}
}
As decribed above, edit this Hello's property, to set the value of Executor to "cvmExecutor". Select the Hello node and execute!

What an complicated output! But this seems to be a usual output when cvm is invoked. The actual result is a simple "Hello" statement at the last line.
For running Xlet applications, I created another new Execution "XletExecution"...you have alrady seen above in Execution list...and edited its properties as follows:
Process:
/home/noniko/personal/build/linux-i686/bin/cvm
Arguments:
com.sun.xlet.XletRunner -name {classname} -path {filesystems}:{classpath}
-args {arguments}
Go to "Filesystems" window, open democlasses node and select the child SimpleXletDemo. Edit its properties to set the value of "Executor" to "XletExecution". Then excute it!

Well, you know, that triangle-shaped chap with a red'n' round nose and black'n'white body holds the strict right of portrait. Anyway, Xlet demo worked successfully in NB environment!
Execution was successfull, but how about development? Let's create a new one. In Japanese magazine JAVA Developer(Softbank Publishing Ltd.) , there was a good sample code for it. Create a new empty class file add required import...

Ah, the strong code completion for the Xlet library too!
It's also a strong help that when you input the statement

Surprise! A window comes out to propose to implement all abstract methods of Xlet interface. Oh, please do. click "Process All".

Then all the framework of method to implement is inserted automatically. All you have to do is fill the content of the empty brackets. How easy!
But a trick is needed, specific to NetBeans IDE.
In NetBeans IDE, the menu item "Execute" is only available for the class with main method. So the quick(and dirty?) way is to create a dummy main method in the source code like:
public static void main(String[] args){
System.out.println("HelloXletFrame called...");
}
So this HelloXletFrame is detected as executable.
![]()
Executing this, you will get the Xlet application run!
Mmmm, it's convenient! How do you think?