OESF Portables Forum

Everything Else => Zaurus - Everything Development => Distros, Development, and Model Specific Forums => Archived Forums => Personal Java/Jeode/J2ME Personal Profile => Topic started by: deepster on October 14, 2004, 05:18:21 pm

Title: Swing on SL-6000
Post by: deepster on October 14, 2004, 05:18:21 pm
New to the Zaurus and a little to Java, but trying to get a version of Swing working on my 6000.  Downloaded swingZ.jar from http://jeffreyrfox.addr.com/zaurus/ (http://jeffreyrfox.addr.com/zaurus/) and tried to run the sample, but it still could not find swing ( NoClassDefFoundError ).  Sounds like a classpath problem, but I believe that I have the simplest config with swingZ.jar and SimpleExample.jar in the same directory and running it with "evm -cp ./swingZ.jar:SimpleClass.jar SimpleClass"

Anyone else got this working on the 6000 or have a better alternative to Swing on Zaurus for the easy creation of dialog windows?

Thanks,
-- Brian
Title: Swing on SL-6000
Post by: Omicron on October 14, 2004, 06:28:55 pm
Quote
New to the Zaurus and a little to Java, but trying to get a version of Swing working on my 6000.  Downloaded swingZ.jar from http://jeffreyrfox.addr.com/zaurus/ (http://jeffreyrfox.addr.com/zaurus/) and tried to run the sample, but it still could not find swing ( NoClassDefFoundError ).  Sounds like a classpath problem, but I believe that I have the simplest config with swingZ.jar and SimpleExample.jar in the same directory and running it with "evm -cp ./swingZ.jar:SimpleClass.jar SimpleClass"

Anyone else got this working on the 6000 or have a better alternative to Swing on Zaurus for the easy creation of dialog windows?

Thanks,
-- Brian


Shouldn't that be ? :

"evm -cp ./swingZ.jar:./[/u]SimpleClass.jar SimpleClass"
Title: Swing on SL-6000
Post by: freizugheit on October 15, 2004, 03:05:17 am
Give EWE VM at http://www.ewesoft.com/M2.htm (http://www.ewesoft.com/M2.htm)  a try.
Title: Swing on SL-6000
Post by: deepster on October 15, 2004, 08:06:59 am
Omicron  - Guess that depends on what your environment settings are.  I am set to serach the present working directory, so ./SimpleExample.jar = SimpleExample.jar

freizugheit - Thanks, will give that a look.

Anyone else get Swing working on th 6000?
Title: Swing on SL-6000
Post by: deepster on October 15, 2004, 08:57:32 am
Well, my problem was (of course) a dumb path problem.  But, once I solved that, I ran into an error

 java.lang.NoSuchMethodError:
 java/awt/Component.getPeer()Ljava/awt/peer/ComponentPeer;

See http://groups.google.com/groups?hl=en&lr=&....com%26rnum%3D1 (http://groups.google.com/groups?hl=en&lr=&client=firefox-a&threadm=b5pnvm%243ml4%241%40news.boulder.ibm.com&rnum=1&prev=/groups%3Fq%3Djava%2BgetPeer%2Bnosuchmethoderror%26hl%3Den%26lr%3D%26client%3Dfirefox-a%26selm%3Db5pnvm%25243ml4%25241%2540news.boulder.ibm.com%26rnum%3D1)

if you run into this.

Thanks,
-- Brian
Title: Swing on SL-6000
Post by: smuelas on October 24, 2004, 12:03:58 pm
I have swing running (compiling and running) with no problems on my 6000.
If anyone needs help, I will be delighted to help.
Santiago Muelas    (smuelas@telefonica.net)
Title: Swing on SL-6000
Post by: AsLan^ on May 21, 2005, 12:20:37 am
Quote
I have swing running (compiling and running) with no problems on my 6000.
If anyone needs help, I will be delighted to help.
Santiago Muelas    (smuelas@telefonica.net)
[div align=\"right\"][{POST_SNAPBACK}][/a][/div] (http://index.php?act=findpost&pid=48225\")

Hi smuelas, I can compile a swing application using jikes and swingZ.jar from [a href=\"http://foxfrenchtranslations.com]http://foxfrenchtranslations.com[/url] however I cannot get it to run with the stock jeode (evm) on my 6000.  I get the same error as the others but I didnt see anything helpful in the link posted by deepster. Any help would be welcome.

Thank you
Title: Swing on SL-6000
Post by: smuelas on May 22, 2005, 07:05:46 am
Hi Aslan,
The only thing that I can tell you is that I've never been able to run satisfactorily "jikes" in my Zaurus. It gives always mistakes with calculations a.s.o. What I do is what follows:
1- I have the "classes.zip" from blackdown's java 1.1.8 and the swingZ.jar in my card.
2- I compile with: evm -cp /mnt/cf/classes.zip:/mnt/cf/swingZ.jar:. sun.tools.javac.Main Myprogram.java
3- I run the compiled program with: evm -cp /mnt/cf/classes.zip:/mnt/cf/swingZ.jar:. Myprogram

Doing that, I've been able to run quiet big Finite Element programs using swing-sliders and all type of buttons, borders, a.s.o.

The other "nice" point about that is that running Debian with Xqt, I have jdk1.1.8 installed. When in Debian, I run the application with: java -classpath /swingZ.jar:. My program
and when in Qtopia as I'have said at the beginning. Compiling from Debian or from Qtopia works o.k. for the other one.

If you have any more problem, please contact me. Good luck
Smuelas
Title: Swing on SL-6000
Post by: AsLan^ on May 23, 2005, 08:53:34 am
Hi smuelas, I tried a couple of different classes.zip from the blackdown java 1.1.8  jdk, specifically i386 v3, arm v1, and arm v2 and I got the same error each time while trying to compile...

java.lang.NoSuchMethodError: java.lang.Character: method isJavaLetterOrDigit©Z not found

followed by at sun.tools.blah for about ten lines.

Any ideas ? is there a specific version of classes.zip that I should be using ?

Thanks for your help

oh and the program I am trying to compile is very simple... its from a java textbook.

import javax.swing.*;

/**
   A simple demo of a window with swing
*/

public class FirstSwingDemo
{
   public static final int WIDTH = 300;
   
   public static final int HEIGHT = 200;
   
   public static void main(String[] args)
   {
      JFrame myWindow = new JFrame();
      myWindow.setSize(WIDTH, HEIGHT);
      
      JLabel myLabel = new JLabel("Please dont click that button");
      
      myWindow.getContentPane().add(myLabel);
      
      WindowDestroyer myListener = new WindowDestroyer();
      myWindow.addWindowListener(myListener);
      
      myWindow.setVisible(true);
      
   }
   
}
Title: Swing on SL-6000
Post by: smuelas on May 25, 2005, 06:09:30 pm
Hi Aslan,
I've tried your class and it works o.k. in the Zaurus. BUT, I've removed the lines:

 WindowDestroyer myListener = new WindowDestroyer();
 myWindow.addWindowListener(myListener);

as I've never heard about a class called "WindowDestroyer".
If you want to "destroy" your class when closing the window, just add instead of this 2 lines, what follows:

addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0); }
});

Anyway, the class runs with no problems. If you are unable to run it, tell me and I will put my "classes.zip" and "swingZ.jar" somewhere for you to download it. O.K.?  :-)

Smuelas
Title: Swing on SL-6000
Post by: AsLan^ on May 26, 2005, 10:43:06 pm
Hi smuelas,

well I tried removing the WindowDestroyer lines but no dice, I still get the same error. Could you please post your classes.zip and swingZ.jar I would be most grateful.

Also, thanks for the code tidbit
Title: Swing on SL-6000
Post by: smuelas on May 30, 2005, 02:18:15 am
Hi Asland, I have put "classes.zip" and "swingZ.jar", both of them in a new compressed package with the name "myjava.zip", in my Debian-Xqt page at
http://w3.mecanica.upm.es/~smuelas/debianxqt.html (http://w3.mecanica.upm.es/~smuelas/debianxqt.html)
Try it.
Regards
Smuelas
Title: Swing on SL-6000
Post by: AsLan^ on May 30, 2005, 06:16:13 am
Thank you for taking the time to post that, unfortunately I still get the same error !

Perhaps its my JVM... evm -showversion displays

java version "J2ME Personal Profile for Zaurus 1.0"
J2ME Personal Profile 1.0 (build 1.0_fcs-b25)
J2ME CDC-HI 1.0_v01

Is this the same as yours ?
Title: Swing on SL-6000
Post by: smuelas on May 30, 2005, 09:19:43 am
Well, don't mind. If you have just said this at the beginning  :-(
What you have is the "personal profile" from Sun. This is a more limited Java than Jeode, and you can't run Swing (to my knowledge) with it.
You should have to uninstall j2me but, perhaps, this is a little bit too complicated for you as it is included with the rom for Z-6000.Instead, try to
get Jeode and install it. A small problem could be that the JVM that you have runs with the instruction "cvm" but there is a link from "cvm" to "evm". If everything goes o.k. you will have cvm in /home/QtPalmtop/j2me/bin/cvm (with a possible link to evm). The "true" evm (the one from Jeode) will be in /home/QtPalmtop/bin/evm.
To use this one it can be convenient to create an alias in your " .bashrc " file in the /home/zaurus directory. You can write a line with:
alias evm='/home/QtPalmtop/bin/evm -cp /path to/myjava.zip:.'
in such a way that you don't have to care anymore about "classes.zip" and/or "swingZ.jar". To compile it should be enough to write:  
evm sun.tools.javac.Main Yourprogram.java
And to run it:   evm Yourprogram
Perhaps I've said something wrong, but I cannot test it now as I'm not at home.
Just, try it and tell me the result.  :-)
And be optimistic: finally, you will run some swing classes. For sure
Smuelas
Title: Swing on SL-6000
Post by: AsLan^ on May 30, 2005, 07:13:50 pm
smuelas, you sir, are the man !

it all works now ! I cant believe I never noticed that jeode and personal java were two seperate programs !

Thank you for all your help,

AsLan^
Title: Swing on SL-6000
Post by: smuelas on May 30, 2005, 07:49:05 pm
Hi Aslan, I'm very happy that everything went so quick and so well for you. Congratulations!! (Now you have a long way to walk with Java and Swing... :-)
I want to mention that I didn't meant to say that Jeode is better or worse than j2me. (In my opinion, jeode is much better, but it is a very humble opinion). The problem for Zauruses is that J2me is based on java2, so from java1.2 on, and it is very constrained in possibilities. On the contrary, Jeode is an optimization of java1.1.8 for Zaurus. It runs quicker, at least in graphics, and is better integrated with QT. Anyway, the BIG problem for j2me is that, to my knowledge, there is only one "swing" available for Zaurus: the "famous" swingZ.jar, based on the swing added to the jdk1.1.8 at the last moment. This swing doesn't run on Java2 software. It needs to use the last versions of java1.
Good luck with Java. I'm keen to it and if you need some help, you know how to contact me (although I don't look so much this site lately...)
Santiago Muelas