LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-12-2006, 07:42 PM   #1
artemis8543
LQ Newbie
 
Registered: Apr 2006
Distribution: Ubuntu 6.06
Posts: 3

Rep: Reputation: 0
java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit


Hi, I just started using Ubuntu 6.06 LTS. When I try to execute a java program using the java ProgramName command, I get this 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.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 Driver.<init>(Driver.java:6)
at Caterpillar.main(Caterpillar.java:24)
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)
...6 more

but it works when i type in the entire path (/opt/jdk1.5.0_06/bin/java)

Compiling works without the entire path, so I think I added it to the PATH correctly...

me@mine:~$ export PATH="$PATH:/opt/jdk1.5.0_06/bin/"
me@mine:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games:/opt/jdk1.5.0_06/bin/

but then when I open a new terminal and do echo $PATH again, the last one isn't there.
What am I doing wrong/haven't I done?

Thanks a lot
 
Old 05-13-2006, 01:58 PM   #2
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 50
change
export PATH="$PATH:/opt/jdk1.5.0_06/bin/"
by
export PATH="/opt/jdk1.5.0_06/bin/:$PATH"
 
Old 05-13-2006, 06:10 PM   #3
artemis8543
LQ Newbie
 
Registered: Apr 2006
Distribution: Ubuntu 6.06
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks, that got rid of the error. But every time I open a new terminal I have to redo that command. Is there any way to make it permanent?
 
Old 05-16-2006, 08:35 PM   #4
artemis8543
LQ Newbie
 
Registered: Apr 2006
Distribution: Ubuntu 6.06
Posts: 3

Original Poster
Rep: Reputation: 0
Could anybody help me with this?
 
Old 05-16-2006, 09:38 PM   #5
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 50
put the line
Code:
export PATH="/opt/jdk1.5.0_06/bin/:$PATH"
in the file /etc/profile
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using AWT on SUSE 9.3 zeppelin147 Programming 1 11-23-2005 12:06 AM
downloading java AWT package zeppelin147 Linux - Software 1 11-17-2005 06:53 PM
Inconsistent behaviour of java.awt in Linux/Windows liangzan Programming 2 09-08-2005 10:34 AM
Java AWT not working naveenhifi Programming 1 02-26-2004 11:35 PM
fluxbox java awt no title bar Kman Linux - Software 0 06-18-2003 11:47 AM


All times are GMT -5. The time now is 03:56 AM.

Main Menu
Advertisement
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 Google+: linuxquestions
Open Source Consulting | Domain Registration