Use Java Swing in RedHat 9.0

K

Ken Tang

Dear all,

I am newbie of this newsgroup. I want to know whether you guys have any
experience in using java swing classes in Redhat 9.0. I installed jdk1.4
(rpm) and set classpath to "tools.jar". I was able to compile and run text
mode java application. However, whenever I tried to compile applications
with swing classes, there was error about missing class. It seems that the
compiler could not locate the swing packages. May you suggest any reason for
that? Thank you in advance.

Ken Tang
 
M

Mladen Adamovic

It seems that you have classpath problem.
Classpath problems are maybe the most frequent problems these days.
I don't catch why you put tools.jar in the classpath?
I suggest try to set classpath empty, if it don't works, try to read SE
issues about classpath.
I hope it helps. If my advice is stupid please don't be angry.
 
S

Sudsy

Ken said:
Dear all,

I am newbie of this newsgroup. I want to know whether you guys have any
experience in using java swing classes in Redhat 9.0. I installed jdk1.4
(rpm) and set classpath to "tools.jar". I was able to compile and run text
mode java application. However, whenever I tried to compile applications
with swing classes, there was error about missing class. It seems that the
compiler could not locate the swing packages. May you suggest any reason for
that? Thank you in advance.

Ken Tang

You supposedly don't have to play with CLASSPATH anymore, although
if you did then you'd want $JAVA_HOME/jre/lib/rt.jar.
 
?

=?iso-8859-1?Q?Nils_O=2E_Sel=E5sdal?=

Dear all,

I am newbie of this newsgroup. I want to know whether you guys have any
experience in using java swing classes in Redhat 9.0. I installed jdk1.4
(rpm) and set classpath to "tools.jar". I was able to compile and run text
mode java application. However, whenever I tried to compile applications
with swing classes, there was error about missing class. It seems that the
compiler could not locate the swing packages. May you suggest any reason for
that? Thank you in advance.
There is no reason to set the classpath for swing, nor any reason to set the
classpath to tools.jar
Just make _sure_ you use the correct java and javac, verify it
with java -version.
You probaly have to use /usr/java/j2sdk-1.4.whatever/bin/java
not just "java"/"javac"
 
B

Babu Kalakrishnan

Ken said:
Dear all,

I am newbie of this newsgroup. I want to know whether you guys have any
experience in using java swing classes in Redhat 9.0. I installed jdk1.4
(rpm) and set classpath to "tools.jar". I was able to compile and run text
mode java application. However, whenever I tried to compile applications
with swing classes, there was error about missing class. It seems that the
compiler could not locate the swing packages. May you suggest any reason for
that? Thank you in advance.

As others already pointed out - don't set the CLASSPATH variable. It
somethimes creates more problems than it solves.

But your actual problem might be quite different. Check out which
"javac" binary you are executing. (which javac will tell you that) It
might most probably be one that was installed by some other package (gcj
?). The best solution is to put an entry in your PATH that has the "bin"
folder of your new java installation ahead of all others.

BK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top