November 21, 2024, 05:14:41 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: java swing and awt !  (Read 13415 times)

Offline creator

  • Linux Noob !
  • *
  • Posts: 7
java swing and awt !
« 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!

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
java swing and awt !
« Reply #1 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 !!

Offline creator

  • Linux Noob !
  • *
  • Posts: 7
Java And AWT
« Reply #2 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 :)

Offline aaa

  • Tux Awared
  • **
  • Posts: 38
java swing and awt !
« Reply #3 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 ?

Offline sudipta_cht

  • Linux Noob !
  • *
  • Posts: 14
java swing and awt !
« Reply #4 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.

Offline dragoncity99

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 551
java swing and awt !
« Reply #5 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. ;)