File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Cattle Drive and the fly likes compiler not finding com.javaranch.common Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "compiler not finding com.javaranch.common" Watch "compiler not finding com.javaranch.common" New topic

compiler not finding com.javaranch.common

Tom Henner

Joined: Jul 04, 2005
Posts: 18
My CattleDrive classes and java files are in c:\java5\javaranch folder.
To support the DaysOld assignment, I copied jr.jar into that folder.
I changed my classpath, adding c:\java5\javaranch\jr.jar; to my last entry, which was c:\java5\javaranch;. Then I rebooted.
I need to reference GDate and JDate that are in jr.jar, and I am trying to get to them through import com.javaranch.common.* ; as my first statement in DaysOld. When I compile at c:\java5\javaranch the compiler complains that com.javaranch.common does not exist. What step am I missing?
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059
I'm not seeing what is causing it not to work. How did you go about changing your CLASSPATH?

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Tom Henner

Joined: Jul 04, 2005
Posts: 18
**UPDATED- FIXED** I had not accepted changes in both steps.
""After making your changes, click on the OK button on both the Environment Variables dialog and the System dialog. You will not need to restart your computer, but you will need to restart any applications which may have read the CLASSPATH settings before your changes (including any Command Prompt windows).""

I'm running Windows 2000 and went to Start>>Settings>>Control Panel>>System>>Advanced>>Environmental Variables and highlighted CLASSPATH from the System Variables window and selected edit. CLASSPATH now looks like this:

C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;C:\Program Files\Microsoft SDK for Java 4.0\Bin;c:WINNT\JAVA\Classes\;C:\Program Files\Microsoft ActiveSync;c:\tom\source;c:\java5\javaranch; c:\java5\javaranch\jr.jar;


[ September 14, 2005: Message edited by: Tom Henner ]
[ September 14, 2005: Message edited by: Tom Henner ]
I agree. Here's the link:
subject: compiler not finding com.javaranch.common
It's not a secret anymore!