By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,915 Members | 1,337 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,915 IT Pros & Developers. It's quick & easy.

Package javax.swing not found in import.

P: n/a
Hi
I am developing an Swing applet. I am using Eclipse as my IDE and I am
compiling the classes through the command line. Everything went ok, but
suddenly it started to give the error "Package javax.swing not found in
import."
I searched Google groups and found that it's a classpath problem, but I
can't seem to get it right. Can anyone help me? And why did it break all of
a sudden, without any changes to the system?

This is my classpath:
C:\Sybase\ASEP\Monclass.zip;C:\Sybase\ASEP\3pclass .zip;C:\Program
Files\Sybase\EAServer\EAServer\PowerBuilder\pdjdbc 12.jar;C:\Program
Files\Sybase\EAServer\EAServer\java\lib\jagtool.ja r;C:\Program
Files\Sybase\Shared\Sun\jdk118\lib\classes.zip;.; C:\Program
Files\Java\j2re1.4.1_05\lib\;C:\j2re1.4.1_05\jre\l ib\
I am running Windows 2000 and JDK 1.4.1_05

Thank you very much
Rui
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
> I am developing an Swing applet. I am using Eclipse as my IDE and I am
compiling the classes through the command line. Everything went ok, but
suddenly it started to give the error "Package javax.swing not found in
import."
I searched Google groups and found that it's a classpath problem, but I
can't seem to get it right. Can anyone help me? And why did it break all of
a sudden, without any changes to the system?

This is my classpath:
C:\Sybase\ASEP\Monclass.zip;C:\Sybase\ASEP\3pclass .zip;C:\Program
Files\Sybase\EAServer\EAServer\PowerBuilder\pdjdbc 12.jar;C:\Program
Files\Sybase\EAServer\EAServer\java\lib\jagtool.ja r;C:\Program
Files\Sybase\Shared\Sun\jdk118\lib\classes.zip;.; C:\Program
Files\Java\j2re1.4.1_05\lib\;C:\j2re1.4.1_05\jre\l ib\


You need to think of your jar files as separate directories. As such
the last two entries in your classpath don't do anything (unless you
have a set of class files in your lib directory). You have to specify
explicitly what jars you want to include in your classpath. Just
referring to a directory in which jar files might be found is not good
enough.

Using a tool like Winzip you can open the jar files and find the jar
file in which the javax.swing package is found. I think the Windows
Explorer will be able to find the jar file that the package is in.
Once you have determined which jar file the package is in, specify
that jar files explicitly in your classpath and it'll start working.

Good luck.

mypetrock
Jul 17 '05 #2

P: n/a
my*******@yahoo.com (Doyle) wrote in message news:<73**************************@posting.google. com>...
I am developing an Swing applet. I am using Eclipse as my IDE and I am
compiling the classes through the command line. Everything went ok, but
suddenly it started to give the error "Package javax.swing not found in
import."
I searched Google groups and found that it's a classpath problem, but I
can't seem to get it right. Can anyone help me? And why did it break all of
a sudden, without any changes to the system?

This is my classpath:
C:\Sybase\ASEP\Monclass.zip;C:\Sybase\ASEP\3pclass .zip;C:\Program
Files\Sybase\EAServer\EAServer\PowerBuilder\pdjdbc 12.jar;C:\Program
Files\Sybase\EAServer\EAServer\java\lib\jagtool.ja r;C:\Program
Files\Sybase\Shared\Sun\jdk118\lib\classes.zip;.; C:\Program
Files\Java\j2re1.4.1_05\lib\;C:\j2re1.4.1_05\jre\l ib\


You need to think of your jar files as separate directories. As such
the last two entries in your classpath don't do anything (unless you
have a set of class files in your lib directory). You have to specify
explicitly what jars you want to include in your classpath. Just
referring to a directory in which jar files might be found is not good
enough.

Using a tool like Winzip you can open the jar files and find the jar
file in which the javax.swing package is found. I think the Windows
Explorer will be able to find the jar file that the package is in.
Once you have determined which jar file the package is in, specify
that jar files explicitly in your classpath and it'll start working.

Good luck.

mypetrock


I finally solved my problem. There was nothing wrong with my PATH or
CLASSPATH vars, they were just declared in the wrong place.
Both variables should be declared under "System Variables" in Windows
2000.

I'm posting this just in case someone has the same problem as me.
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.