[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit



On Thu, 02 Nov 2006 16:14:02 +0100
Blackwell <blackwell@nexgo.de> wrote:

> > On Nov 2, 2006, at 5:57 AM, Clayton wrote:
> > 
> >> Hi,
> >>
> >> I am not so familiar with Java, and I am trying to get my brokers
> >> Java trading app working on my notebook. I am running Debian Etch
> >> with the following Java environment installed:
> >>
> >> $ wajig list-installed | grep java
> >> java-common
> >> java-gcj-compat
> >> libhsqldb-java
> >> libjaxp1.2-java
> >> libjline-java
> >> libservlet2.3-java
> >> libxalan2-java
> >> libxerces2-java
> >> libxt-java
> >> openoffice.org-java-common
> >> sun-java5-bin
> >> sun-java5-demo
> >> sun-java5-fonts
> >> sun-java5-jdk
> >> sun-java5-jre
> >> sun-java5-plugin
> >>
> >> When I try to invoke the app, the following happens:
> >>
> >> s$ java -cp 
> >> jts.jar:pluginsupport.jar:jcommon-1.0.0.jar:jfreechart-1.0.0.jar:jhall.jar:other.jar:rss.jar 
> >> -Xmx256M jclient.LoginFrame .
> >> Exception in thread "JTS-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 java.awt.Frame.<init>(libgcj.so.70)
> >>    at javax.swing.SwingUtilities$OwnerFrame.<init>(libgcj.so.70)
> >>    at javax.swing.SwingUtilities.getOwnerFrame(libgcj.so.70)
> >>    at javax.swing.JOptionPane.<clinit>(libgcj.so.70)
> >>    at java.lang.Class.initializeClass(libgcj.so.70)
> >>    at jutils.td.a(td.java:69)
> >>    at jutils.xb.a(xb.java:105)
> >>    at jutils.xb.b(xb.java:69)
> >>    at jclient.LoginFrame.a(LoginFrame.java:308)
> >>    at jclient.LoginFrame.b(LoginFrame.java:290)
> >>    at jclient.LoginFrame.main(LoginFrame.java:448)
> >> Caused by: java.lang.NoClassDefFoundError: 
> >> gnu.java.awt.peer.gtk.GtkToolkit
> >>    at java.lang.Class.initializeClass(libgcj.so.70)
> >>    at java.lang.Class.forName(libgcj.so.70)
> >>    at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)
> >>    ...14 more
> >>
> >> It looks like maybe something isn't installed or a configuration 
> >> problem, any suggestions?
> >>
> >> I have this same Java app working on my desktop, so I know it
> >> works, but I am using older Java packages on the desktop, so I am
> >> not sure the two machines are really comparable.
> 
> Note the "libgcj" bits in the error message.
> 
> Here is the simple and pragmatic solution if you do not have issues 
> with using "non free" software:
> 
> Whenever you get error messages with that substring in them, install 
> Sun Java, remove GCJ if you can, and ensure that your Linux 
> installation (other operating systems do not exhibit this problem as 
> far as I know) is configured to use Sun Java for any Java 
> application (each Linux distribution may have a different approach 
> to configuring which "Java" implementation to use).
> 
> (It is good that you reported to this list, feedback to developers 
> is very important.)
> 
> With best regards
> Blackwell

Thanks, that worked like a charm:

# apt-get remove gcj-4.1-base                        
....
Removing java-gcj-compat ...
Removing libgcj7-jar ...
Removing gij-4.1 ...
Removing libgcj7-0 ...
Removing gcj-4.1-base ...

and now it just works, no other configuration required.

Clayton



Reply to: