Computing.Net > Forums > Linux > Javax.swing class not found

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Javax.swing class not found

Reply to Message Icon

Name: t-bone
Date: September 26, 2003 at 18:45:44 Pacific
OS: linux mandrak 9.0
CPU/Ram: 333
Comment:

When i go to compile a java program using the import javax.swing.*; i get a JFrame class not found!! i have the path set to usr/local/j2sdk1.4.1_02/bin: but in that dir isnt there supposed to be javax*? i see java*, javac* javadoc* etc. every program i write compiles until i import the javax.swing.*;




Sponsored Link
Ads by Google

Response Number 1
Name: Jonathan
Date: September 26, 2003 at 20:24:56 Pacific
Reply:

You seem to be missing some knowledge of te fundamentals of Java programming. The files in /usr/local/j2sdk.1.4.1_02/bin are the utilities (tools) included as part of the Java 2 SDK - i.e., the compiler, the interpreter, the javadoc tool, etc...

javax.swing.* is an API package that comes with the Java 2 platform. It contains many classes. There is no javax file in your bin directory. All standard API classes are included in the file rt.jar, which will be somewhere under the jre directory. You do not need them in your path. You do not need to extract them from the jar file. You *do* need to fix your classpath, or your java installation. If there is a system variable named CLASSPATH, clear it and your java program should compile. If that doesn't fix it, make sure your syntax and spelling are correct in your import statments. If it still isn't fixed, your Java installation is probably corrupted.

Jonathan


0

Response Number 2
Name: t-bone
Date: September 29, 2003 at 17:17:52 Pacific
Reply:

I just installed the j2sdk1.4.2_01, made the export PATH=/home/joe/j2sdk1.4.2_01/bin:${PATH}

on another computer it is installed j2sdk1.4.1_02, directory structure same path and compiles and runs fine

I echo CLASSPATH and get a blank line, so there must be no classpath set.

this is the error i am getting on compile:
SwingApplication.java:44: error:Variable "UIManager" is not defined in current context
SwingApplication.java:48: error:Cannot find class "JFrame" [JLS 8]


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Javax.swing class not found

Linux , eth0 device not found www.computing.net/answers/linux/linux-eth0-device-not-found/23494.html

command not found www.computing.net/answers/linux/command-not-found/24569.html

IDE command not found www.computing.net/answers/linux/ide-command-not-found/19715.html