[Tinyos-help] error in running java program (SerialForwarder andTestSerial) in linux ubuntu

Janos Sallai sallai at isis.vanderbilt.edu
Mon Feb 25 09:20:50 PST 2008

First, you have some problems with your java installation. Although most of the tinyos java tools should work with gcj/CLASSPATH, you're better off with installing a Sun JDK or an IBM JDK. Also, make sure that the current directory is on the classpath, as well as the tinyos jar files.
Please see http://www.tinyos.net/tinyos-2.x/doc/html/install-tinyos.html for details.


From: tinyos-help-bounces at millennium.berkeley.edu on behalf of bayu anggorojati
Sent: Mon 2/25/2008 10:15 AM
To: tinyos-help at millennium.berkeley.edu
Subject: [Tinyos-help] error in running java program (SerialForwarder andTestSerial) in linux ubuntu


I am installing the tinyOS linux ubuntu. Basically I can successfully compile and install the tinyOS program. But when I tried to run a java program, such as SerialForwarder it gave me the following error: 
Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
   at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)
   at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(libgcj.so.70)
   at java.awt.Window.<init>(libgcj.so.70)
   at java.awt.Frame.<init>(libgcj.so.70)
   at javax.swing.JFrame.<init>(libgcj.so.70)
   at net.tinyos.sf.SFWindow.createGui(SFWindow.java:87)
   at net.tinyos.sf.SerialForwarder.<init>(SerialForwarder.java:105)
   at net.tinyos.sf.SerialForwarder.main(SerialForwarder.java:92)
Caused by: java.lang.UnsatisfiedLinkError: libgtkpeer: libgtkpeer.so: cannot open shared object file: No such file or directory
   at java.lang.Runtime._load(libgcj.so.70)
   at java.lang.Runtime.loadLibrary(libgcj.so.70)
   at java.lang.System.loadLibrary(libgcj.so.70)
   at gnu.java.awt.peer.gtk.GtkToolkit.<clinit>(libgcj.so.70)
   at java.lang.Class.initializeClass(libgcj.so.70)
   at java.lang.Class.forName(libgcj.so.70)
   at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)
   ...7 more

I also found out that other java program is also not working, like the TestSerial program. The error when I was running TestSerial (java) program is as follows:
Exception in thread "main" java.lang.NoClassDefFoundError: TestSerial
   at gnu.java.lang.MainThread.run(libgcj.so.70)
Caused by: java.lang.ClassNotFoundException: TestSerial not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/opt/tinyos-2.x/support/sdk/java/tinyos.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.70)
   at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.70)
   at java.lang.ClassLoader.loadClass(libgcj.so.70)
   at java.lang.ClassLoader.loadClass(libgcj.so.70)
   at gnu.java.lang.MainThread.run(libgcj.so.70)

Is there anything that is missed here, like installing the package, setting the environment or whatever?
Thank you in advance for your help.

Best Regards,

More information about the Tinyos-help mailing list