Use Java Swing in RedHat 9.0

Use Java Swing in RedHat 9.0

Post by Ken Tan » Sun, 16 Nov 2003 01:55:11


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
 
 
 

Use Java Swing in RedHat 9.0

Post by Mladen Ada » Sun, 16 Nov 2003 05:42:54

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.



for

 
 
 

Use Java Swing in RedHat 9.0

Post by Suds » Sun, 16 Nov 2003 07:02:47


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

Use Java Swing in RedHat 9.0

Post by Nils O. Se » Sun, 16 Nov 2003 07:03:46


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"
 
 
 

Use Java Swing in RedHat 9.0

Post by Steve W. J » Sun, 16 Nov 2003 07:38:48

In article < XXXX@XXXXX.COM >,




Sun advises against using the CLASSPATH variable, and I agree. Instead,
I always set it in the command line. But there should never be a need
to put rt.jar in the classpath since that's automatically included in
the bootclasspath when you use the javac and java commands.

While I haven't done any significant work in Red Hat 9, I did install
1.4.1_02 there recently and compiled a small test class. And I
installed a copy of our fully developed application, which includes a
1.4.1_02 JRE bundled with it. It ran just fine on Red Hat 9.

= Steve =
--
Steve W. Jackson
Montgomery, Alabama
 
 
 

Use Java Swing in RedHat 9.0

Post by Babu Kalak » Sun, 16 Nov 2003 14:45:54


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