05-09-2007, 07:49 AM | #16 |
No es el toro que piensas
Posts: 44
Karma: 10
Join Date: Mar 2007
Device: iRex iliad
|
My first tricks with java over iliad. This is what I'm doing:
Compile a dummy class that show a silly message (on com/irex/sdk): Code:
javac -source 1.2 -target 1.2 MyOwnTest.java Code:
jar cvfm javi.jar Manifest -C com/ . If I lauch this on iliad the following messages arises: Code:
root@ereader:/home/intent# sys/platform/linux/taoref/er10xx/elate -B sys/platform/linux/taoref/er10xx/target.img -g2 -l sys/platform/linux/taoref/er10xx/ "-capp/stdio/jcode -classpath javi.jar com.irex.sdk.MyOwnTest" intent (Linux boot loader) Copyright (c) Tao Systems Ltd 1997-2000 0x564E24 bytes read Booting image at 0x401ce000-0x405ce400 Sys/kn/init/p_start: Device _init failed [-24] ! '/device/screen' will not be mounted. app/stdio/jcode: (*env)->FindClass returned an exception java.lang.NoClassDefFoundError: com.irex.sdk.MyOwnTest java.lang.NoClassDefFoundError.<init>(Ljava/lang/String;)V Not obviously (to me): why don't know my class? Can scotty1024 or other mobileread guru give me a hint? I have never fighted against jar files and I will follow trying to run this, but if somebody here could help me, I would be very grateful |
05-09-2007, 09:12 AM | #17 | |
iLiad fan
Posts: 210
Karma: 3864
Join Date: Oct 2006
Device: iRex iLiad
|
Quote:
Code:
jar cvfm javi.jar Manifest com |
|
Advert | |
|
05-09-2007, 05:38 PM | #18 |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
elate could care less about your manifest, you have to supply the name of the class to execute on the command line to it.
Here's my test, a slide show program that sucks images out of a ZIP file. It invokes the e-ink updates e.g. its "ported" to the iLiad. To compile: javac -classpath irex.jar -source 1.3 -target 1.1 Test1.java To Jar: jar cf Test1.jar Test1*.class To run it I use this shell script: Code:
#!/bin/sh EXECPATH=sys/platform/linux/taoref/er10xx IMGPATH=$EXECPATH export DISPLAY=:0 export ELATE_FB_TTY=/dev/tty0 #export ELATE_KTRACE=/tmp/ktrace.log export ELATE_DEBUGSTUB=7990 cd /home/intent/ if [ ! -d /home/intent/ROOTDIR ] then ln -s / ROOTDIR fi JVMARGS="-v -classpath $1;MobipocketCoreReader.jar;kxml2-2.3.0.jar;irex.jar OPTIONS="-capp/stdio/jcode $JVMARGS" exec $EXECPATH/elate -B $IMGPATH/target.img -g2 -l $EXECPATH "$OPTIONS" The elate can't see file's that begin with /, you have to use the ROOTDIR symlink to get to them. Tap the screen to exit the program. The -v lets you see the classes load, important for sussing out why elate is having heart burn over your code. The commented out ktrace lets System.out go to the console. Last edited by scotty1024; 05-09-2007 at 05:40 PM. Reason: a couple more notes |
05-09-2007, 05:57 PM | #19 |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
Based on the help text it emits it appears there is a developer.img and we have the stripped down target.img. The stack traces it generates contain no line number information (so I don't bother compiling with -g) and generally the messages are cryptic and obtuse.
Here's some of what I have figured out. Code:
[Loaded java/lang/NoClassDefFoundError/class] [Loaded java/lang/LinkageError/class] java.lang.NoClassDefFoundError: `>@ java.lang.NoClassDefFoundError.<init>(Ljava/lang/String;)V Test1.paint(Ljava/awt/Graphics;)V java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V java.awt.EventQueue$Delegate.dispatchEvent(Ljava/awt/AWTEvent;)V java.awt.EventDispatchThread.()V java.lang.Thread._run()V Code:
java.lang.NoSuchMethodError Test1.<init>()V Test1.main([Ljava/lang/String;)V These can be very annoying to track down. I'm sure Tao has a Java environment with just the supported classes and methods in it but for now... Code:
app/stdio/jcode: (*env)->FindClass returned an exception java.lang.NoClassDefFoundError: com.surerange.mobiled.SendFax java.lang.NoClassDefFoundError.<init>(Ljava/lang/String;)V com.tao_group.sys.Eclassloader.()V com.tao_group.sys.Eclassloader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class; java.lang.ClassLoader.loadClass(Ljava/lang/String;)Ljava/lang/Class; Code:
app/stdio/jcode: (*env)->FindClass returned an exception java.lang.NoClassDefFoundError: EV java.lang.NoClassDefFoundError.<init>(Ljava/lang/String;)V |
05-10-2007, 04:01 AM | #20 | |
No es el toro que piensas
Posts: 44
Karma: 10
Join Date: Mar 2007
Device: iRex iliad
|
Quote:
|
|
Advert | |
|
05-10-2007, 11:17 AM | #21 |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
The above simple image viewer can be used to demonstrate that Tao didn't accelerate PNG files. GIF and JPG files load very rapidly, sub-second. PNG files though take 6 or 7 seconds to load.
|
05-10-2007, 12:09 PM | #22 |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
A dump of the System Properties from the Intent elate JVM on the iLiad. Sort of a Dog's Breakfast... not quite Desktop, not quite J2ME, not quite Applet.
Note the user.region of GB if you are writing for the North American region. Code:
http.maxConnections: 5 user.region: GB file.separator: / java.content.handler.pkgs: uk.co.tao.net.www.content line.separator: java.compiler: unknown user.dir: / java.awt.Component.setCursor.isRestricted: true microedition.platform: intent JTE awt.image.animationdelay: 100 microedition.profiles: PBP-1.0,FP-1.0 awt.font.kerning: false awt.image.type: -1 path.separator: ; awt.window.refreshMax: 40 os.name: intent awt.toolkit: com.tao_group.awt.peer.AWTToolkit os.version: 2.2.1 user.name: unknown buildlocale: International awt.image.priority: 5:4:1 awt.window.refreshMin: 20 awt.defaultFont: Serif-plain-12 user.timezone: GMT awt.image.incrementalDraw: true awt.image.redrawrate: 100 http.proxySet: false awt.window.borders: false awt.repaint.mergefactor: 25 awt.window.buffered: true java.home: /sys/j *: added by makefile.jcode.sys java.class.path: . user.home: / os.arch: VP 2.1 net.mimeDecoder: uk.co.tao.net.www.SimpleMime user.language: en awt.textured: true java.awt.event.KeyEvent.supportMask: 2 awt.repaint.priority: 1 java.class.version: java.vendor.url: http://www.tao-group.com/ java.protocol.handler.pkgs: uk.co.tao.net.www.protocol awt.priority: 9 java.vendor: Tao Group Limited net.simpleMimeFile: /uk/co/tao/net/www/SimpleMime.txt java.io.tmpdir: /tmp java.version: awt.component.passEvents: true awt.window.titlebars: false awt.image.maxThreads: 4 http.defaultConnectionTimeout: 15 java.awt.event.KeyEvent.isRestricted: true file.encoding: 8859_1 microedition.configuration: CDC-1.0 |
05-10-2007, 01:44 PM | #23 |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
The "applications" in Intent
I don't think all of these are turned on in the provided target.img, xlet for example just returns no matter what arguments you provide. Code:
app/launch/mem/class app/launch/mem/_delete app/launch/mem/_new app/launch/launchtool app/launch/process_line app/dis/tooldbg app/stdio/javaprofile app/stdio/jcode app/stdio/xlet app/stdio/launch app/stdio/shutdown |
05-10-2007, 01:58 PM | #24 |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
All the Applet stuff seems to be missing in action.
For example there is no java.awt.Panel, java.awt.TextArea, or java.awt.ScrollPane. I don't think iRex realizes how much easier it would be to port Java applets to the iLiad than all those X Windows apps. My guess is that they wanted the smallest target.img they could get away with. It may be to make this thing really useful we may have to come up with an applet environment. Which could very likely have the iLiad stuff built in and thus allow running stock Java applets. Last edited by scotty1024; 05-10-2007 at 02:59 PM. Reason: Added more missing Applet classes |
05-10-2007, 04:51 PM | #25 |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
Java DJVU shows its first page on the iLiad
They say 90% of the battle is knowing you can do something. Here's a screen shot of my hacked version of the Java DJVU Viewer running in Intent on the iLiad.
Now that I've got a page up, time to get the rest of the iRex API implemented so I can page around inside the document. |
05-15-2007, 07:32 AM | #26 | |
No es el toro que piensas
Posts: 44
Karma: 10
Join Date: Mar 2007
Device: iRex iliad
|
Quote:
There's no choice to give user an ordinary input?? Ouf, I'll continue doing dummy things |
|
05-15-2007, 08:48 AM | #27 |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
Tao sells a variety of Booster Packs for their Intent environment. iRex bought what iRex bought.
iRex got into a similar problem with the Mobipocket Viewer and dealt with it by adding in stuff, probably from GNU's Classpath project. I've been investigating adding an AWT, Applet and Swing booster pack from that source.. I'm actually thinking it might be possible to have Applets be automatically ported to the iLiad by tweaking the Applet support elements with the iLiad calls in the right places. |
05-15-2007, 12:16 PM | #28 |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
More on buttons.
iRex supplies a light weight button: com.irex.mobipocket.reader.SimpleButton public SimpleButton(String label, Graphics g, int x, int y, int w, int h) Code:
Graphics g = getGraphics(); SimpleButton sb = new com.irex.mobipocket.reader.SimpleButton("OK", g, 100, 100, -1. -1); // -1 gets you whichever of 200x50 sb.paint(); addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent mouseevent) { if(sb.getBounds().contains(mouseevent.getPoint())) { System.out.println("clicked on button:" + mouseevent.getPoi\ nt()); } } } ); |
05-15-2007, 03:05 PM | #29 |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
Hmm, I've used reflection to study the java.awt.Component in the target.img and there is no getPeer or setPeer. My guess is they use deus ex machina to hook up the peers in their library. We have the peers in the image but the classes to utilize them are missing and I suspect the classes have to pre-bound into the target.img for deus ex machina to work.
So I'm going to do like iRex and adapt light weight components to java.awt interfaces. Except unlike iRex I'm going to do it properly. I've also got a full java.applet from GNU's Classpath and I'm welding that together for the iLiad. In time we may have a full javax.swing as well. I don't know how Cellphone Java Games will look on the iLiad's slow e-ink panel but we should be ready to try them shortly. |
05-15-2007, 05:24 PM | #30 |
Enthusiast
Posts: 43
Karma: 2898
Join Date: Jan 2007
Location: Belgium
Device: iRex iLiad, PRS-600
|
Maybe this is a silly suggestion, but couldn't you just compile the necessary classes yourself? Sun made most of java open source, the (almost) complete source code can be found here (it seems some stuff from the graphics classes - mainly Java2D stuff - is missing because of some copyright issues). For example here is the AWT source.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
iRex DR1000 Development VMWare Image | Adam B. | iRex | 9 | 08-19-2010 04:23 AM |
iRex DR1000 Software Development website | vwinstead | iRex | 23 | 02-04-2009 12:21 PM |
iRex Community Development Help | Adam B. | iRex | 33 | 02-02-2008 07:12 PM |
iRex Open Community Development | Adam B. | iRex | 16 | 12-05-2007 04:31 PM |
iLiad Other Java development options...? | thisisfrancis | iRex Developer's Corner | 5 | 09-27-2007 09:23 AM |