I just downloaded and installed sdk 1.4.0. I am trying to complile my first swing code, but I get the following error: No variable EXIT_ON_CLOSE defined in class javax.swing.JFrame From reading the docs, I belive that this was a new addition to 1.4 from 1.3. However I belive that I am currently running 1.4 on my system. I can type java -version at the dos command line and I see that I do in fact have Standard Edition (1.4.0) running. My File: -------- c:\code\java\application\firstswing\HelloWorld.swing CLASSPATH --------- CLASSPATH=.;c:\j2sdk1.4.0;c:\code\java\application\firstswing
My Code: --------
Can someone please tell me what I am doing wrong?
Timothy Willard
Greenhorn
Joined: Apr 03, 2001
Posts: 25
posted
0
Sorry I made a typo in my post. My file is actually c:\code\java\application\firstswing\HelloWorld.java not of type .swing
Your code worked just fine for me, and I use jdk 1.3.1
CLASSPATH is for running. You are having problems compiling. What is your PATH? [ March 01, 2002: Message edited by: Marilyn deQueiroz ]
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Timothy Willard
Greenhorn
Joined: Apr 03, 2001
Posts: 25
posted
0
Marylin, Thank you for taking the time to look at my problem. I can see that there are a million posts in the Saloon that touch on the subjects PATH and CLASSPATH. You pointed me in the right direction and I fixed my problem. I have several applications that have values posted in my PATH, pvcs, oracle, ms sql server 7.0, other business software, and even Java 2 version 1.2, and Java 2 version 1.4. I cleared out my path completely and just added Java 1.4 and my first swing application ran fine. I am wondering if there was a problem with having both Java 1.2 and Java 1.4 in my PATH at the same time. I did some reading up on this issue and from my understanding it sounded like this was possible. Anyway.... The whole PATH and CLASSPATH issues have always been a tough one for me to tackle. Thanks again.
It is possible, but what matters (to Java) is order.
If the jdk1.3 packages are found on the PATH before the jdk1.4 package, then the compiler will use jdk1.3, and thus, not find the new stuff in 1.4
Simply putting the 1.4 stuff at the beginning of your PATH (ensuring it is first, before jdk1.3 or oracle jre's or other jre's) would solve the problem.