• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Compiling problem - CLASSPATH is the issue

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am so new at this so pardon me:
I downloaded the new SDK 1.4.0_1 and installed- no issue. I bought a book called learning Java 2 and I created my first .java file, a simply text display. The book tells me to edit my CLASSPATH (which I fully understand the concept) to direct it to the c:|sdk1.4..\bin folder. I did that however when I go to compile the file (for example purposes: the file is called Ellsworth.java). I am in DOS and navigate to the directory where the Ellsworth.class file is and enter the command
javac Ellsworth.java
I receive the error "javac is not recognized ,etc..
However, if I move the file to the bin folder where the SDK was installed and run teh command
javac Ellsworth.java
it works and it compiles it and creates a .class file like it should. But my probme is this, why do I have to save the .java file to the directory where the SDk is installed. Can' I have the option of saving anywhere I want and set the CLASSPATH? I am thinking the CLASSPATH is not taking somehow but if i type in
SET in the DOS prompt : it shows the correcgt path.
I am using Windows XP and I think there is something missing that I need to do. If anyone can help please do.. Much appreciated
~D
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
dlovallo,

Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner!
 
dlovallo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually I figured it out. I am glad that I did becuase you learn more when this like this arise.
The problem was that there was another entry called PATH and it already had some directories in it so what I did is added
;c:\sdk1.4.0_01\bin to the end and it works.
Looks like you need to put int he directory in 2 places.
I am sure I will be back here asking some more ?'s..
~D
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why do I have to save the .java file to the directory where the SDk is installed.
You won't have to do that once everything is properly configured.
It looks like you need to adjust your PATH setting. Your PATH setting simply needs to include the path to [your java SDK folder]/bin directory.
Are you familiar with doing this through the control panel? If not, go to the Advanced tab in the System control panel and click on the Environment Variables. If you already have a PATH variable, then edit it to include the aforementioned directory; otherwise create a new variable named PATH with a value that includes the appropriate directory.
Making sense? Any luck?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I figured it out.
Yeeha! Now you're ready to have some fun.
Um, about that display name thing... [ nudge, nudge ]
[ June 22, 2002: Message edited by: Dirk Schreckmann ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic