| Javac
on EPOC |
|||
| * |
Compiling Java on EPOC Release
5
Last updates:
|
||
| * |
PSION ships a Java Runtime Environment (JRE)
for EPOC with their PSION Series 5mx (PRO). As for all JREs it does
not include a Java compiler. So you are able to run Java applications/applets,
but you won't be able to develop "on the road".
But as the Java compiler provided with SUN's JDK is itself written in Java, there is no reason why not to install this feature on your favourite PDA. This page provides you with the easy steps necessary to teach your EPOC on how to compile Java from the source. Here we go: |
||
| * |
Grab the EPOC Java SDK with
it's emulator (it's free!) (note from 2011: good luck with that!) If you got the real device make sure to have the JRE installed,
supplied to you on the CD (Series 5 MX) or CF-Card (Serie 5 MX
PRO) that came with your PDA. If you own an Ericsson MC218 you can find the JRE on Ericssons mobile internet pages at http://mobileinternet.ericsson.se/. You must sign up there first. Please note that you must have a contract with a moblie phone operator to be eligible to sign in.... Click on "Products" then "Ericsson Software", select "MC 218". Scroll down and you will find a link to the Java Virtual Machine. You have exactly 3 tries to perform the download. Doesn't that make you feel like a valued costumer? |
||
| * |
Get the JDK 1.1
for your desktop computers OS and install it. The JRE for EPOC is based on Version 1.1.4 including some additional fixes; currently available from SUN is 1.1.8. I used 1.1.8 and it worked fine. If you encounter compile problems consider getting a Linux 1.1.x Version from http://www.blackdown.org/. Create a directory called "c:\classes" on your EPOC device. On the emulator that would be D:\epoc32\Wins\C\classes where D: is the drive letter of the SDK installation. |
||
| * |
Locate the file lib\classes.zip in the installation
directory of the JDK on your desktop computer
Open it with winzip or your favourite ZIP tool |
||
| * |
Extract all files stored under
to an empty folder on your PC; e.g. c:\tmp\javac Pack the extracted files into a zip file again (using winzip you can do this by rightclicking the javac folder and selecting "Add to javac.zip". Make sure you didn't strip the directory information or garble the filena~1 of the unzipped files. Rename the new zipfile to javac.jar and copy it to c:System\Java\ext\ on your device. With zip's compression turned on this file is 316k on my machine. Symbian has made some optimizations to their java implementation on the device. This included putting some classes into the VM itself. The compiler can't find these classes, we therefor need a copy of the original classes as well. These classes are |
||
| * |
java/awt/*.class Note that this is a simplified list; if you want to save a few bytes stick to the the actual list of missing classes. You'll most probaly not need the sun/* classes, as they may not be accessed directly in 100% pure Java programs - they are therefor not needed by the compiler. Perform the same steps with these missing classes as with the
javac classes. Put them in a zip file called missing.jar and place
it in c:\classes\lib\ on your PSION. |
||
| * |
You need a litte wrapper application so you can do without a
commandline. It will also modify the CLASSPATH so 'missing.jar'
can be found by the compiler. Additionally it will prevent the
VM from quitting after compilation. As the VM doesn't need to
start again with every compile run, this will greatly increase
perfomance. Download the wrapper
and unpack it to C:classes. The console is disabled by default on the real machine (not on the emulator). It can be activated by creating a file (of any type) called console in a folder called ?:\system\java\. You might want to do this before using the compiler. |
||
| * |
Write a little test source - this
is a very popular one.
Go to folder C:classes on your EPOC |
||
| * |
Enter the filename of your Java sourcefile (omit
the path unless your playing with "packages")
Click Ok The program will now (hopefully) compile. Note that a new .class file has been created in c:\classes |
||
| * |
Run your App by clicking the .class file.
|
||
| * |
Enjoy! :) If you are looking for a text editor to use on your EPOC device, you might want to check out http://pda.dk/pdalt/pdajava/je5/. You'll find java editor there, that can make use of this pages javacwrapper as a plug-in. |
||
| * |
Questions and comments are welcome.
|
||
| * |
Revision History February 18, 2011
March 23, 2000 Added lots of links to amazon.com for your shopping delight ;-) Updated the
information on how to get the JRE for the MC218 November 15, 1999
October 14, 1999
Compiler does not quit after compilation now, resulting in up to 50% performance increase in subsequent compilations.
I got my Series 5mx PRO this monday - ordered it last friday; well done MobiTec and Deutsche Post AG :)
|
||