• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

oop-1 Class path

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm having trouble to try compile DaysOld class on Windows 98. I keep getting this message:
DaysOld.java:1: package com.javaranch.common does not exist
import com.javaranch.common.*;
My class path looks like this:
SET CLASSPATH=.;C:\Java;C:\Java\JavaRanchCommon.zip
I included this line in my class:
import com.javaranch.common.*;

Does anybody knows what's wrong? Any help would be great!
Thanks,
Moni
 
Chicken Farmer ()
Posts: 1932
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try changing the .zip to .jar, both for the file and for the classpath.
Hope that works,
Jason
 
Monika Balogh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did, what you recommended. So I have the jar file what the zip was in the Java folder and changed my class path to:
SET CLASSPATH=.;C:\Java;C:\Java\JavaRanchCommon.jar;
It does not work. The same message poped up.
Any other suggestions?
Thanks,
Moni
 
jason adam
Chicken Farmer ()
Posts: 1932
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know this sounds like a typical IT response, but did you reboot after making those changes? I had to after modifying my classpath, wouldn't work until then, don't know if that was a problem with my system or a needed step for your system to recognize it.
Jason
 
Monika Balogh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I did. It does not make any difference.
moni
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like you've done everything correctly. I would re-download the zip file. I'm not home right now, so I can't check what the exact size should be, somewhere around 167 KB. Occasionally, it will get corrupted while downloading.

It should not make a difference whether it is .zip or .jar in this case -- the JVM knows it is a .jar even though it has a .zip ending.

I've used the zip file on Win95, Win98, WinNT and Win2000, so that's not the problem.
 
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moni, Forgive me, but I'm going to ask a dumb question: Did you place the com folder in the folder named java on your C drive?
 
Monika Balogh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the suggestions but still don't work. I tried replacing the old zip file. It's now 164kb. Something is still wrong with it. The compiler does not seem to see this package.
I keep trying.
Thanks again.
moni
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
164,716 bytes using the dir command in the DOS window?
 
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you compiling it, via an editor (ie TextPad) , IDE , or javac ?
Also make sure your dir where your java stuff * zip file is in is realy c:\Java and not c:\java. Dos is not case sensative but javac is.
Another one , what version of the sdk are you using ?. I think I read somewhere that one of the older versions expected the packages to be in a jar file and not in a zip file.
Hope this helps
 
Monika Balogh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for all your replies. It's great to know that people read these messages.
I ckecked the size of the zip file again and it is 164,716 byte. My directory is called Java. I'm using Version 1.3 SDK.
Any suggestions?
moni
 
Johannes de Jong
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You forgot to answer this one :
"How are you compiling it, via an editor (ie TextPad) , IDE , or javac ?"
If you do use an IDE or editor.
Try compiling it from your c:\Java using javac. Check your classpath first though to make sure its ok . If it compiles ok we know its your IDE or editor
 
Monika Balogh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I managed to tidy up my class path and seem to work. I had too many parameters and made mistakes in the Autoexec file.
Thanks for all your help.
Moni
reply
    Bookmark Topic Watch Topic
  • New Topic