• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Problem w/ Compile - possible assistance needed in classpath

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry I made a typo in my post. My file is actually
c:\code\java\application\firstswing\HelloWorld.java
not of type .swing
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Timothy Willard
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic