This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Compiling problem - CLASSPATH is the issue  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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 ]
 
Pay attention! Tiny ad!
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!