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 Help with CLASSPATH variable please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help with CLASSPATH variable please" Watch "Help with CLASSPATH variable please" New topic
Author

Help with CLASSPATH variable please

Atreo De Maio
Greenhorn

Joined: Nov 28, 2005
Posts: 10
Hi everyone!!

Please, help to set up my classpath variable. I know I know I have guidelines in API but I don't achieve it, I'm so clumsy.

I've formated my hard disk and installed everything again, but the classpath is wrong because I can't compile my java files.

I've tried with this:

C:\Program Files\Java\jdk1.5.0_06\scr.zip;C:\Program Files\Java\jdk1.5.0_06\javac.exe;C:\Program Files\Java\jdk1.5.0_06\java.exe

I've also tried with the same lines but unnaming files (finishing with '\')

What am I doing wrong?

Thank you very much for your attention and help.
Merry Christmas and Happy New Year!!

And I hope the Three Wise Men bring you everything!!


Hey! Thanks a lot for your help.
Stuart Goss
Ranch Hand

Joined: Mar 21, 2001
Posts: 169
Perhaps you need quotes (" ") around the paths. I see you have whitespace in the directory names (I hate them).

But what is the error message you are seeing?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

None of those things need to be in your classpath, anyway, so it doesn't matter that there are spaces in their path names. Try reading this classpath tutorial:

http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html
Atreo De Maio
Greenhorn

Joined: Nov 28, 2005
Posts: 10
Hi there!!

First of all, THANK YOU VERY MUCH for answering.

The thing is that none of the suggestions worked and I don't know why. This is becoming in the typical annoying fly...

Any other suggestion? Maybe I have to install something else?
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Is it the CLASSPATH you're trying to set, or the PATH? What are you doing, and what errors are you getting?

Setting the PATH variable allows you "to conveniently run the JDK executables (javac.exe, java.exe, javadoc.exe, etc.) from any directory without having to type the full path of the command." To set the PATH, see these installation instructions for 32-bit Windows. (For other operating systems, click here.)

Setting the CLASSPATH variable "tells JDK tools and applications where to find third-party and user-defined classes." To set the CLASSPATH, see these JavaRanch instructions or Sun instructions.
[ January 04, 2006: Message edited by: marc weber ]

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Tom Never
Greenhorn

Joined: Jan 11, 2006
Posts: 7
My path statement for windows XP has jdk1.5.0_06\bin That's where java.ex exits, I wouldn't put in the java.exe either.
Tom

C:\Program Files\Java\jdk1.5.0_06\scr.zip;C:\Program Files\Java\jdk1.5.0_06\javac.exe;C:\Program Files\Java\jdk1.5.0_06\java.exe

I've also tried with the same lines but unnaming files (finishing with '\')

What am I doing wrong?

Thank you very much for your attention and help.
Merry Christmas and Happy New Year!!

And I hope the Three Wise Men bring you everything!! [/QB]
Anju sethi
Ranch Hand

Joined: Dec 26, 2005
Posts: 91
hi,

Please set PATH variable for all executables (javac and java) and CLASSPATH variable for output files and any other third party classes (all jar files).

for eg. if you have a program "test.java". you compile it with javac(executable) and your output file that is test.class is generated in c:/myClasses.

Then to run this program. you must set java(executable) in PATH variable and c:/myClasses path along with other jars in CLASSPATH variable.

The java executable picks up appropriate class file path from CLASSPATH variable. you can place a dot(.) for picking up class file from current working directory.

I hope now u will be able to solve ur problem.

thanks
sethi


thanks,<br />Anju Sethi
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
If you are posting in this forum, then you should NOT use the CLASSPATH variable AT ALL. You should delete it completely.

If that still does not fix the problems you have encountered, please describe what you are doing and what error messages you get. These details will help us fix your exact problem rather than wasting your time with out best guesses.

Layne


Java API Documentation
The Java Tutorial
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with CLASSPATH variable please