HELP! Compiler error with J2SDK 1.4.0_01

Using the Java SDK with TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
HELBringer

HELP! Compiler error with J2SDK 1.4.0_01

Post by HELBringer »

I'm using TextPad.
I'm using the 1.4.0_01 version of the sun development kit.
I'm running WindowsXP Home Edition
Now that we've got the pleasantries out of the way...

The compiler works great if I don't import any custom libraries, such as javax.swing.*

HOWEVER... the compiler errors out when I try to import said custom libraries from the Sun kits.

For example:
- - - - - - - - - - - - - - - - - - - - -
import java.io.*;
import javax.swing.*;

public class palindromes
{
public static void main (String[] args)
{
String rpt;
rpt = JOptionPane.showInputDialog (null, "you get the idea");
- - - - - - - - - - - - - - - - - - - - -

yields the ONLY error as being:
- - - - - - - - - - - - - - - - - - - - -
C:\Documents and Settings\HELBringer\My Documents\Java files\palindromes.java:2: Package javax.swing not found in import.
- - - - - - - - - - - - - - - - - - - - -

(p.s. - this code compiles and runs great on the school computers, using textpad, and running under 98. However, our teacher was able to go into autoexec.bat and change the environment variable to correct the compiler error. Without the autoexec.bat file to use under XP, I'm lost)

I know that the javax.swing library lives in a zip file called SRC.ZIP, which lives in the C:\j2sdk1.4.0_01\ root directory. However, it seems that I can't get the right environment variable set in the PATH section to get the #(%&! thing working. Does ANYBODY know the correct path to use to get this to work for me?

My Computer - Properties - Advanced (tab) - Environment Variables - (select) PATH - (add) ????????????

I'm about ready to beat my computer in with a bat, so if you have any suggestions....

-Bringer <'//><
WUTTD

Re: HELP! Compiler error with J2SDK 1.4.0_01

Post by WUTTD »

Don't add the filename to the variable PATH. Create a new variable called CLASSPATH...
John

Re: HELP! Compiler error with J2SDK 1.4.0_01

Post by John »

What is the step in creating CLASSPATH?

thanks
Jaime

Re: HELP! Compiler error with J2SDK 1.4.0_01

Post by Jaime »

Using Java 1.4.1 I am experiencing the same thing. I, however, run Windows 2000. I am not able to import javax.swing and unable to create maps. Please Help! I need the information ASAP for a school project!
Post Reply