Using SuperWaba on Mac OS X to develop for PalmOS


There is a newer version of this HERE for SuperWaba 3 and OS X 10.2.



Using SuperWaba on Mac OS X to develop for PalmOS

  1. Overview
  2. Installing SuperWaba
  3. Compiling Using SuperWaba
  4. Other Info
  5. Links

OVERVIEW

Installing the Waba SDK or the SuperWaba SDK allows you to develop software for the PalmOS using a subset of the Java language. This page is a record of what I had to do to get the SuperWaba SDK installed on Mac OS X.

The instructions on this page are based on my install on OS X 10.1.5. This page is greatly informed by Christopher C. Stump's 'SuperWaba for the Linux Newbie'. Part of the install is specific to an OS X system with Fink installed - if you don't have Fink you might consider taking a moment to install that now...

Please if there is something wrong with these instructions, or if there is a better way to have accomplished any of this, or if you have any questions.

[disclaimer]
You can not hold me responsible for anything that might go wrong due to you having visited this web page.

- John Murden, 2002/07/15


INSTALLING SUPERWABA
  1. Download the SuperWaba 2.4 SDK from here (.sit, 2.3 MB). Once expanded, you end up with a directory 'org'.

  2. Put the directory org somewhere in your file structure that makes sense to you. The example changes below are based on 'org' being placed in /Library/Java/Extensions/ .

  3. The location of the files in 'org' needs to be added to your environment variable CLASSPATH so that the Java VRM knows where to find these files.

    If you have installed Fink...
    • Open Terminal.app and type sudo pico /sw/bin/init.csh

    If you have not...
    • Open Terminal.app and type pico .cshrc

  4. Add the following line (all as one line, no line breaks) , replacing the bold text with the path to where you have placed the 'org' directory:

    setenv CLASSPATH /System/Library/Frameworks/JavaVM.framework/Classes/classes.jar:
    /System/Library/Frameworks/JavaVM.framework/Classes/ui.ja:
    /Library/Java/Extensions/:
    /Library/Java/Extensions/org/superwaba/palm/classes/:
    /Library/Java/Extensions/org/superwaba/palm/classes/SW20.jar:
    /Library/Java/Extensions/org/superwaba/palm/bin:.

    Note the last ':.', this is necessary to include the current working directory in the classpath. Without this addition, compilation will fail.

  5. You need to log out and log back in for these changes to take effect.

COMPILING USING SUPERWABA

With the SuperWaba SDK in place and the classpath properly defined, one can begin developing SuperWaba applications. We will assume the reader has already written a SuperWaba program called HelloWorld.java .

In order to test/run this program either on a Palm OS device or POSE, we must transform the .java source code into a Palm OS executable .prc file. This can be accomplished in a few easy steps:

  1. #Change to the directory with the SuperWaba source
    [command prompt]% cd {path to SuperWaba source}

  2. #Compile source
    [command prompt]% javac HelloWorld.java

  3. #Run Warp on the newly created .class files
    [command prompt]% java Warp c HelloWorld HelloWorld.class

  4. #Run Exegen on the .class files
    [command prompt]% java Exegen HelloWorld HelloWorld HelloWorld

Warp is a java program found in /Library/Java/Extensions/org/superwaba/palm/bin/. Warp's purpose is to create the .pdb files used by Palm OS applications and the .wrp files used by Windows CE devices. We are only concerned with the .pdb file. The first argument to Warp, c, tells the program to create a .pdb file. The second argument is the name of the to-be-created .pdb file, and the third argument is all of the .class program files.

Exegen is a java program that can also be found in same directory as Warp. Exegen's purpose is to create the .prc file, which is the SuperWaba program in Palm OS executable form. The first argument to Exegen is the name of the to-be-created .prc file. The second argument is the name of the main source code file. The third argument is the name of the .wrp file.

If the above steps were successful, a ready-to-use/test Palm OS application should be in the current directory. There should be files called MySuperWabaApp.prc and MySuperWabaApp.pdb . Both of these files, along with the SuperWaba virtual machine files, must be installed on a Palm unit or POSE in order to run the application. The SuperWaba virtual machine files can be found in /Library/Java/Extensions/org/superwaba/palm/ .


OTHER INFO

The above command line arguments can be tedious to type repeatedly while developing. Therefore, it is much nicer to place all of the commands in a simple shell script so everything can be easily run in sequence with a single command. To do this:

With Fink installed:
  1. Download and uncompress the superwaba_maker.sh script.

  2. #Change to the directory where you downloaded superwaba_maker.sh
    [command prompt]% cd {path to superwaba_maker.sh}

  3. #make the script executable
    [command prompt]% chmod 755 superwaba_maker.sh

  4. #move the script to your bin directory
    [command prompt]% mv superwaba_maker.sh /sw/bin/superwaba_maker.sh

  5. You need to log out and log back in for these changes to take effect.

Once you have logged back in, in the same directory as your HelloWorld.java, do the following to automatically compile the HelloWorld.class and run Warp and Exegen:

#Invoke shell script to handle SuperWaba app creation
[command prompt]% superwaba_maker.sh HelloWorld


Without Fink installed:
  1. Download and uncompress the superwaba_maker.sh script.

  2. #Change to the directory where you downloaded superwaba_maker.sh
    [command prompt]% cd {path to superwaba_maker.sh}

  3. #make the script executable
    [command prompt]% chmod 755 superwaba_maker.sh

Place superwaba_maker.sh in the same directory as your HelloWorld.java and do the following to automatically compile the HelloWorld.class and run Warp and Exegen:

#Invoke shell script to handle SuperWaba app creation
[command prompt]% ./superwaba_maker.sh HelloWorld


LINKS

SuperWaba Home
http://www.superwaba.org/

Waba Home
http://www.wabasoft.com/

Waba on SourceForge
http://waba.sourceforge.net/

Waba/SuperWaba discussion
news://news.falch.net/pilot.programmer.waba

Apple Developer Connection - Java
http://developer.apple.com/java/
http://developer.apple.com/techpubs/macosx/Java/java.html

SuperWaba for the Linux Newbie - Christopher C. Stump
http://www.parmly.luc.edu/cstump/www/other/waba-howtos/intro-howto.htm
http://www.parmly.luc.edu/cstump/www/other/waba-howtos/superwaba-howto.htm

Example - SuperWaba Application as an Applet
http://www.lestercat.net/dev/palm/scribble/

Using SuperWaba on Mac OS X to develop for PalmOS (newest version)
http://www.lestercat.net/dev/superwaba/



.
lestercat.net