File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Compiling problem - CLASSPATH is the issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compiling problem - CLASSPATH is the issue" Watch "Compiling problem - CLASSPATH is the issue" New topic
Author

Compiling problem - CLASSPATH is the issue

dlovallo
Greenhorn

Joined: Jun 15, 2002
Posts: 2
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
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
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!


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
dlovallo
Greenhorn

Joined: Jun 15, 2002
Posts: 2
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

Joined: Dec 10, 2001
Posts: 7023
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

Joined: Dec 10, 2001
Posts: 7023
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.
 
subject: Compiling problem - CLASSPATH is the issue