kaffe and swing - NoSuchMethodError

G

giangiammy

Hi all,

running some demos on my kaffe port (kaffe 1.1.6, compiled
for mips machine, using Tiny-X), I testet successfully
some programs using awt, now, I have a demo using swing,
and the program fails as it do not find
javax/swing/JComponent.setDropTarget!

When I run it with:

LD_PRELOAD=/usr/X11R6/lib/libX11.so:/usr/lib/libpng.so:/usr/lib/libz.so:/usr/local/lib/libjpeg.so
kaffe -Dkaffe.awt.nativelib=xawt
-Xbootclasspath/p:/home/AMDgiammy/kaffe-1.1.6/kaffeawt.jar JButtons

I get the following error:

java.lang.NoSuchMethodError:
javax/swing/JComponent.setDropTarget(Ljava/awt/dnd/DropTarget;)V
at javax.swing.JComponent.<init> (JComponent.java:413)
at javax.swing.JRootPane.<init> (JRootPane.java:499)
at javax.swing.JFrame.createRootPane (JFrame.java:214)
at javax.swing.JFrame.getRootPane (JFrame.java:199)
at javax.swing.JFrame.frameInit (JFrame.java:151)
at javax.swing.JFrame.<init> (JFrame.java:113)
at JButtons.<init> (JButtons.java:15)
at JButtons.main (JButtons.java:11)

It seems it do not find swing library: is it correct?
I have looked into rt.jar (compiled on host PC and the copied on
MIPS machine), and I see am entry

-rw-rw-r-- 24643 20-Oct-2005 08:37:38
javax/swing/JComponent.class

so I think the swing library is present.

Do I need to enable some flags when running the demo?
How can I tell where to find the library?


thanks for the help
giammy

Here the example code:

import java.awt.*;
import javax.swing.*;

/** Simple example illustrating the use of JButton, especially
* the new constructors that permit you to add an image.
* 1998-99 Marty Hall, http://www.apl.jhu.edu/~hall/java/
*/

public class JButtons extends JFrame {
public static void main(String[] args) {
new JButtons();
}

public JButtons() {
super("Using JButton");
//WindowUtilities.setNativeLookAndFeel();
//addWindowListener(new ExitListener());
Container content = getContentPane();
content.setBackground(Color.white);
content.setLayout(new FlowLayout());
JButton button1 = new JButton("Java");
content.add(button1);
ImageIcon cup = new ImageIcon("images/cup.gif");
JButton button2 = new JButton(cup);
content.add(button2);
JButton button3 = new JButton("Java", cup);
content.add(button3);
JButton button4 = new JButton("Java", cup);
button4.setHorizontalTextPosition(SwingConstants.LEFT);
content.add(button4);
pack();
//setSize(500, 200);
setVisible(true);
}
}
 
D

David N. Welton

Hi all,

running some demos on my kaffe port (kaffe 1.1.6, compiled
for mips machine, using Tiny-X), I testet successfully
some programs using awt, now, I have a demo using swing,
and the program fails as it do not find
javax/swing/JComponent.setDropTarget!

You might make sure that you have a recent Classpath, as I know that
it's still a work in progress.
Gianluca Moro http://groups.yahoo.com/group/embeddeditalia/
ISCRIVITI alla Mailing List Italiana su LINUX EMBEDDED
(e-mail address removed) Visit http://ilpinguino.altervista.org/

Out of curiousity, what size system are you working with? Perhaps there
are smaller toolkits out there than J2SE...

Saluti,
--
David N. Welton
- http://www.dedasys.com/davidw/

Linux, Open Source Consulting
- http://www.dedasys.com/
 
G

giangiammy

Hi,

My system has 32M flash + 32M RAM:
if you have a link to other smaller toolkits,
let me know: I will get a try...

thanks
giammy
 
E

Eric

Hi,

My system has 32M flash + 32M RAM:
if you have a link to other smaller toolkits,
let me know: I will get a try...

thanks
giammy

Try jamvm, wonka, sablevm...
There's also the Sun CDC reference implementation. I don't know if they
make a JIT downloadable.
All should be quite small. Wonka and the Sun JIT should be quite fast;
jamvm and sablevm are pure interpreters IIRC.

Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top