LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 07-17-2006, 05:00 AM   #1
Reegz
Member
 
Registered: Mar 2006
Location: South Africa
Distribution: Ubuntu, Slackware, openSuse
Posts: 44

Rep: Reputation: 15
Java Gtk error


Hi guys. I upgraded my distro from ubuntu 5.10 to 6.06 this weekend.

i'v now tried running a java swing app and am getting the following error

Code:
Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
   at java.awt.Toolkit.getDefaultToolkit(libgcj.so.7)
   at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(libgcj.so.7)
   at java.awt.Window.<init>(libgcj.so.7)
   at java.awt.Frame.<init>(libgcj.so.7)
   at javax.swing.JFrame.<init>(libgcj.so.7)
   at Frame1.<init>(Frame1.java:9)
   at Frame1.main(Frame1.java:53)
Caused by: java.lang.ClassNotFoundException: gnu.java.awt.peer.gtk.GtkToolkit
   at java.lang.Class.forName(libgcj.so.7)
   at java.lang.Class.forName(libgcj.so.7)
   at java.awt.Toolkit.getDefaultToolkit(libgcj.so.7)

I'v checked for the lib it refers to

Code:
root@rac:/home/rac/tmp/SMSWizard# ll /usr/lib/libgcj.so.7.0.0 /usr/lib/libgcj.so.7
lrwxrwxrwx 1 root root       15 2006-07-14 23:39 /usr/lib/libgcj.so.7 -> libgcj.so.7.0.0
-rw-r--r-- 1 root root 21225540 2006-04-22 04:06 /usr/lib/libgcj.so.7.0.0

Any ideas on what the problem is here?
 
Old 07-17-2006, 06:47 AM   #2
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 50
Try install java from java.sun.com instead of using gcj(from gnu software fondation). There is also a ubuntu wiki for java. On slackware there is a j2sdk package available from repositories.
 
Old 07-17-2006, 08:09 AM   #3
Reegz
Member
 
Registered: Mar 2006
Location: South Africa
Distribution: Ubuntu, Slackware, openSuse
Posts: 44

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by mrcheeks
Try install java from java.sun.com instead of using gcj(from gnu software fondation). There is also a ubuntu wiki for java. On slackware there is a j2sdk package available from repositories.

Hi. Thanks for the reply. I am developing in java. Currently using jdk1.5. so I dont think this can be related.
 
Old 07-17-2006, 08:40 AM   #4
Reegz
Member
 
Registered: Mar 2006
Location: South Africa
Distribution: Ubuntu, Slackware, openSuse
Posts: 44

Original Poster
Rep: Reputation: 15
Please excuse my stupidity!!!

You were right. I was using the wrong java version. The java being used was

Code:
/usr/bin/java
which as you stated is the gij java. I have changed this to point to the correct version which i have installed in

Code:
/usr/local/java
Thanks again
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java GTK+ plaf Lobais Linux - Software 2 09-10-2006 11:53 AM
no swt-pi-gtk-3138 in java.library.path vlaspld Linux - Software 2 07-24-2006 11:44 AM
java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit artemis8543 Linux - Newbie 4 05-16-2006 08:38 PM
GTK error when starting gtk-chtheme Dswissmiss Linux - Software 1 10-01-2004 11:53 PM
compiling gaim/ gtk error (two versions of gtk) webazoid Linux - Software 0 07-06-2004 06:05 PM


All times are GMT -5. The time now is 04:42 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration