wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Problem w/ Compile - possible assistance needed in classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem w/ Compile - possible assistance needed in classpath" Watch "Problem w/ Compile - possible assistance needed in classpath" New topic
Author

Problem w/ Compile - possible assistance needed in classpath

Timothy Willard
Greenhorn

Joined: Apr 03, 2001
Posts: 25
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
Sorry I made a typo in my post. My file is actually
c:\code\java\application\firstswing\HelloWorld.java
not of type .swing
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
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
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.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem w/ Compile - possible assistance needed in classpath
 
Similar Threads
My *stupid* questions...
HelloWorldSwing
Swing not working ...
java for slide
Big problem with Sun online tutorial: Swing