Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Virtual Machine / October 2005

Tip: Looking for answers? Try searching our database.

kaffe and swing - NoSuchMethodError

Thread view: 
giangiammy@gmail.com - 25 Oct 2005 08:58 GMT
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);
 }
}

--
Gianluca Moro          http://groups.yahoo.com/group/embeddeditalia/
ISCRIVITI alla         Mailing List Italiana su LINUX EMBEDDED
giangiammy@yahoo.com   Visit http://ilpinguino.altervista.org/
Roedy Green - 25 Oct 2005 10:50 GMT
On 25 Oct 2005 00:58:38 -0700, "giangiammy@gmail.com"
<giangiammy@gmail.com> wrote, quoted or indirectly quoted someone who
said :

>It seems it do not find swing library: is it correct?

use the code in http://mindprod.com/where.html
to quickly see what classes are present and which jar they are in.

See also http://mindprod.com/jgloss/classpath.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.

giangiammy@gmail.com - 25 Oct 2005 11:07 GMT
thank you for the answer,

> use the code in http://mindprod.com/where.html

I'm looking at your site, but the where.html page is not found

thanks
giammy
--
Gianluca Moro          http://groups.yahoo.com/group/embeddeditalia/
ISCRIVITI alla         Mailing List Italiana su LINUX EMBEDDED
giangiammy@yahoo.com   Visit http://ilpinguino.altervista.org/
Roedy Green - 25 Oct 2005 14:39 GMT
On 25 Oct 2005 03:07:41 -0700, "giangiammy@gmail.com"
<giangiammy@gmail.com> wrote, quoted or indirectly quoted someone who
said :

>> use the code in http://mindprod.com/where.html
>
>I'm looking at your site, but the where.html page is not found

Long ago I reorged my site, yet I keep typing the old names. All the
regulars know about my failing and how to compensate. I have redirects
in for some of my most common blunders.

I should have said:

http://mindprod.com/jgloss/where.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.

David N. Welton - 25 Oct 2005 13:48 GMT
> Hi all,
>
[quoted text clipped - 3 lines]
> 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
> giangiammy@yahoo.com   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,
Signature

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

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

giangiammy@gmail.com - 26 Oct 2005 07:42 GMT
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
--
Gianluca Moro          http://groups.yahoo.com/group/embeddeditalia/
ISCRIVITI alla         Mailing List Italiana su LINUX EMBEDDED
giangia...@yahoo.com   Visit http://ilpinguino.altervista.org/
Eric - 27 Oct 2005 21:41 GMT
> Hi,
>
[quoted text clipped - 8 lines]
> ISCRIVITI alla         Mailing List Italiana su LINUX EMBEDDED
> giangia...@yahoo.com   Visit http://ilpinguino.altervista.org/

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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.