• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

servlets  RSS feed

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i got 2 situations :
1) when i set the classpath to JavaRanchCommon.zip it disables the compiler to see the other classes that i extended or used in composition even if these classes are in the same directory as that of the base class (doing other programs other than cattle drive). so i took off the JavaRanchCommon.zip from the classpath and set it only as needed. this worked well...
the thing is, when i got to servlets i saw the direction: set the classpath to j2ee.jar. this would again go back to the problem. is there any other way to it? isn't j2ee important not only during cattle drives but also in developing real life programs? which means it would need to be permanently in the system unlike JavaRanchCommon.zip so i can't do what i did before.
would it be possible to set the path instead to j2ee.jar like we do in jdk1.x/lib?

2) direction : copy JavaRanchCommon.zip to c:\orion\lib\JavaRanchCommon.jar would this just mean that i rename the file to .jar in dos console?
thanks a many
meri krismas en a hapi nu yir tu ol!!!
in case i won't be able to get online before then he he he
[ December 20, 2002: Message edited by: Benjoe Reyes ]
 
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A CLASSPATH can point to all needed jar files!
Very often a "." (the active directory) should not be forgotton! The different items should be separated by a ; (semicolon).
Does this help?
Merry Christmas to all readers!
 
Sheriff
Posts: 9087
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) when i set the classpath to JavaRanchCommon.zip it disables the compiler to see the other classes that i extended or used in composition even if these classes are in the same directory as that of the base class (doing other programs other than cattle drive). so i took off the JavaRanchCommon.zip from the classpath and set it only as needed. this worked well...

You want to add JavaRanchCommon.zip to your CLASSPATH, not replace your CLASSPATH with it. Your CLASSPATH should contain your base directory as well as the JavaRanchCommon.zip file.

isn't j2ee important not only during cattle drives but also in developing real life programs? which means it would need to be permanently in the system unlike JavaRanchCommon.zip so i can't do what i did before.

Yes. The stated purpose of the first OOP assignment is, "To learn how to use someone else's classes, how to integrate a jar file into your program"

would it be possible to set the path instead to j2ee.jar like we do in jdk1.x/lib?

PATH is different than CLASSPATH. Be sure not to confuse the two. They have different functions.

2) direction : copy JavaRanchCommon.zip to c:\orion\lib\JavaRanchCommon.jar would this just mean that i rename the file to .jar in dos.


Yes.
 
Benjoe Reyes
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks people!!!
 
Benjoe Reyes
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Marilyn de Queiroz:
You want to add JavaRanchCommon.zip to your CLASSPATH, not replace your CLASSPATH with it. Your CLASSPATH should contain your base directory as well as the JavaRanchCommon.zip file.


miss Marilyn what do you mean by base directory be contained in the classpath? the c:\ dir?
seen your profile ma'am i should say you are one busy lady... music and computer in one
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think with "Base directory" the directory you are busy is meant : set CLASSPATH = .;c:\thisorthat;d:\classtojavaranch\javaranchcommon.jar;d:\andsoon\peter.jar
See the point in front? Thats to my believe the basedirectory.
Have a good start into 2003!
 
Benjoe Reyes
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Peter....
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!