Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with CLASSPATH variable please

 
Atreo De Maio
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!
 
Stuart Goss
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Tom Never
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic