This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't configure classpath for OOP-1

 
Paul Ralph
Ranch Hand
Posts: 313
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, OK, so I'm nowhere near this assignment. While I'm waiting to hear back from Marilyn, I've been doing the assignments that are up ahead. I get them to run, refine them the best I can, and I'll submit them when the time comes.
Anyway...
I have this in my autoexec.bat file
PATH=C:\JDK1.3\BIN;%PATH%;
set CLASSPATH=.;C:\JavaFiles;C:\JavaFiles\JavaRanchCommon.zip;%CLASSPATH%
and JavaRanchCommon.zip is in C:\JavaFiles
but I still can't get my compiler to find com.javaranch.common.*
What am I doing wrong?
Thanks
Paul R
 
Richard Boren
Ranch Hand
Posts: 233
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul, I'm doing the same as you - working ahead.
I had the same problem. I had to put the javaranchcommon.zip in my jdk1.3 dir before the compile could find com.javaranch.common.*.
This is the classpath I am using.
SET CLASSPATH=C:\jdk1.3\javaranch\javaranchcommon.zip;D:\My_Java\;.;
I don't know if this is the best way, but it works.
Could you tell me what the %CLASSPATH% does? I haven't been using it.
 
Johannes de Jong
tumbleweed
Bartender
Posts: 5089
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul what compiler are you using ?
 
Paul Ralph
Ranch Hand
Posts: 313
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No luck.
It now looks like this:
PATH=C:\JDK1.3\BIN;%PATH%;
SET CLASSPATH=C:\jdk1.3\javaranch\javaranchcommon.zip;.;
Could some of the rest of the autoexec.bat be interfering? I don't know what else to think. I've tried compiling from the
C:\jdk1.3\javaranch\ directory. I'm stumped.
Thanks for trying, though.
Paul R
 
Paul Ralph
Ranch Hand
Posts: 313
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Johnannes: JDK 1.3.0 I use Windows95 Any other info that would be helpful?
Paul R
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this in my autoexec.bat file
PATH=C:\JDK1.3\BIN;%PATH%;


Looks good as far as it goes. What is in %PATH% ?


set CLASSPATH=.;C:\JavaFiles;C:\JavaFiles\JavaRanchCommon.zip;%CLASSPATH%
and JavaRanchCommon.zip is in C:\JavaFiles


This looks good, too. What does your import statement look like? (I assume all your *.java files and your *.class files are in C:\JavaFiles)

 
Johannes de Jong
tumbleweed
Bartender
Posts: 5089
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul sorry I meant do you compile directly from a editor or at the dos prompt. Sometimes the editor does not see the classpath and you have to manually set it in the options of the editor.
In you statement :
set CLASSPATH=.;C:\JavaFiles;C:\JavaFiles\JavaRanchCommon.zip;%CLASSPATH%
Try it like this :
set CLASSPATH=C:\JavaFiles;C:\JavaFiles\JavaRanchCommon.zip;
Good luck

[This message has been edited by Johannes de Jong (edited April 26, 2001).]
 
Paul Ralph
Ranch Hand
Posts: 313
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am grateful to say it now works. Ultimately it worked because Marilyn pointed me to an incorrect import statement. (I had it as com.javaRanch.common.* ; ) However, I know that wasn't the only problem because capitalizing the R was the last desperate thing I tried before starting this thread. I don't technically know if Johannes had an assist or not, but...
I don't care. I give credit and MANY THANKS TO YOU BOTH!!!

Paul R

[This message has been edited by Paul Ralph (edited April 27, 2001).]
 
Johannes de Jong
tumbleweed
Bartender
Posts: 5089
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually the capital R came from Marilyn I only cut & pasted her line , remember she is the nitpicker always checking the finer points
gee I wish I tried harder at spelling in school
[This message has been edited by Johannes de Jong (edited April 27, 2001).]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic