• Post Reply Bookmark Topic Watch Topic
  • New Topic

swing install on suse7.0, sdk1.4.0  RSS feed

 
Tom Vassell
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I'm having difficulty with Swing on my Suse7.0 machine. I successfully installed j2sdk1.4.0 and can compile and run programs
with classes imported from java.io.*, java.awt.*, and java.net.*...
When I try to import from java.swing.* though I get the error:
"Package javax.swing not found in import"

I installed j2sdk1.4.0 with the following directory structure:
/home/thomas/javastuff/j2sdk1.4.0
the contents of the j2sdk1.4.0 folder are:
COPYRIGHT README.html demo javax lib src.zip
LICENSE bin include jre man sunw
README com java launcher org

Inside the above directories I could not find any swing.jar files or swing*.jar files...
I added javax and javax/swing to the .profile file for /home/thomas
as such:
CLASSPATH=/home/thomas/javastuff/j2sdk1.4.0/javax:/home/thomas/javastuff/j2sdk1.4.0/javax/swing/*.java:.
export CLASSPATH
This has not helped. Still getting the same error. Anyone have any ideas?? Is the above syntax incorrect? Did I miss something? I'm a Newb to Linux. All comments and suggestions are welcome. Thanks. --T
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I try to import from java.swing.* though I get the error

Do you really mean "java.swing.*" ?
It should be "javax.swing.*"
What's your PATH environment variable set to be?
What do you get when you type "which java" and "java -version"?
Define an environment variable "export JAVA_HOME=/home/thomas/javastuff/j2sdk1.4.0"
Then update your PATH environment variable:
"export PATH=$JAVA_HOME/bin:$PATH"
Also (for now) use an empty CLASSPATH environment variable (better still delete it)
-Barry
Using Java 1.4.1_01 on Suse 7.3
[ October 29, 2002: Message edited by: Barry Gaunt ]
 
Tom Vassell
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Barry....I meant "javax.swing"
I updated the PATH as you suggested above.
I also removed the previous classpath info from the .profile file...
"which java" returns "/usr/lib/java/bin/java"
"java -version" returns "java version 1.18"
I am still getting the error:
"Package javax.swing not found in import"
Any ideas? Thanks for the earlier input. -- T
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at that "java version 1.18"
you should be getting "java version 1.4.0", so the
java in "/usr/lib/java/bin/java" is the WRONG java.
If you define JAVA_HOME and redefine PATH as I specified in my first post you should be pick up
the java 1.4.0 that you installed.
Do that next, you are on the right way...
-Barry
 
Tom Vassell
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Barry...thanks for your suggestions...they worked eventually!! Removed the older version and correctly configured the new. Can now compile and run swing as well.......
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!