Linux Forums - Linux Help,Advice & support community:LinuxSolved.com

Linux in General => Linux Development & Programming => Topic started by: creator on March 06, 2004, 06:12:59 PM

Title: java swing and awt !
Post by: creator on March 06, 2004, 06:12:59 PM
Hi !
I am using java awt package under linux (red hat 9.0), and running jdk1.4. The program compiles, but fails on run!!! The same program executes under windows :)
wht do i do?
And i have imported com.sun.java.swing for swing packages..my javac doesnt find swing package! Do i have to set classpaths? how do i do it to make a permanent change in the CLASSPATH ?

Thanks in advance :)
Vish!
Title: java swing and awt !
Post by: Ricky on March 07, 2004, 12:44:14 PM
Can you tell us that wht u have done to compile and run ur probrame. little description !!
Title: Java And AWT
Post by: creator on March 07, 2004, 07:40:46 PM
Yeah...
I use javac ...the program runs under Windoz env..perfectly....
the same program...gives me a runtime error under linux..
it says ..GNU cannot load awtToolKit !
and gives me a host of other following errors!
what do I do ?
Please Let me know ...
Thank you!

worst yet ....programs with the swing package that run under windows wont compile under linux ...says
cannot find package javax.swing.*
and therefore
cannot resovle symbol JFrame ., JPanel...and so on...
how do i deal with this...
Thanks in advance :)
Title: java swing and awt !
Post by: aaa on March 18, 2004, 04:33:36 PM
Quote
worst yet ....programs with the swing package that run under windows wont compile under linux ...says
cannot find package javax.swing.*
and therefore
cannot resovle symbol JFrame ., JPanel...and so on...
how do i deal with this...
did you set the CLASSPATH ?
Title: java swing and awt !
Post by: sudipta_cht on April 06, 2004, 08:17:22 AM
Go to the /etc/profile file
in it, just before the environment variables are exported, write
CLASSPATH="$CLASSPATH:/usr/java/j2sdk1.4.whatever/lib/tools.jar:."
Also, on the line that exports all these variables, add the CLASSPATH variable, too. That should work.
Title: java swing and awt !
Post by: dragoncity99 on April 06, 2004, 10:48:31 AM
Have u really compile the program?

How do u run the program. It's very different u know to run the program u wrote in java and in windows.

From what i see, u either use the JSDK, and not Sun One Studio.
Try Sun One Studio 4 just in order to relief headache if u want and IDE to help u fix it. ;)