This is a tutorial, that shows step by step how to use installed Java on the IPhone. Just in case you do not have Java installed on your IPhone there is a tutorial how to do it.
Step 1: Create simple Java application, compile and run.
Create file Java4IPhone.java and put simple Java hello-world code there. I used the following code:
Upload to IPhone. I used /tmp directory. For uploading I used IPhone Browser.
Run Terminal.
Use command java -fullversion or jamvm -fullversion to see if java is avaliable.
Use command jikes to invoke java compiler.
Go to /tmp directory, using command cd /tmp
Compile. We need to specify classpath to basic java packages. If we do not do that, jikes will produce an error (see screenshot). So use the following command:jikes Java4IPhone.java -cp /usr/lib/rt.jar
After compiling Java4IPhone.class file should appear in the same directory. To run use commandjava Java4IPhone
Take a look at the screenshots. Hopefully you’ll have something similar.
how would you compile using other packages? I’m trying to compile processing, so I need to use the “core.jar”
WithRat
June 24th, 2009 at 11:28 AM
how can i compile java UI Applications with jikes?
And where can i get documents of the lib jocstrap.jar?
Thanks!
WithRat
June 24th, 2009 at 11:36 AM
I got these when i tried to compile file JavaSysInfo.java:
E:\javapro>javac JavaSysInfo.java
JavaSysInfo.java:31: can not file symbol
symbol: method fullScreenApplicationContentRect()
location: class obc.UIHardware
CGRect rect = UIHardware.fullScreenApplicationContentRect();
^
JavaSysInfo.java:34: can not find symbol
symbol: method defaultSize()
location: class obc.UINavigationBar
CGSize sizenavbar = UINavigationBar.defaultSize();
^
2 errors
Is it that the jocstrap(jocstrap_1.0.2549-8_iphoneos-arm.deb) I got does not fit the source files?
Comments