Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

set CLASSPATH?

 
Sandra Baker
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a question in regards to CLASSPATH.... according to Sun's documentation :
"....You only need to set the class path when you want to load a class that's (a) not in the current directory or in any of its subdirectories, and (b) not in a location specified by the extensions mechanism."
I have all my classes wrapped in the packages under scjd directory, so I guess I don't need to ask examiner set any classpath. Right? Here is my file structure:
E:\scjd\client (contains all client classes)
E:\scjd\db (contains all db classes)
E:\scjd\server (contains all server classes)
E:\scjd\service (contains all server interface classes)
So, if I ask the examiner to extract my main jar file under E:\scjd, JVM should be able to find all classes without any CLASSPATH set, am I correct on this? Please help....thanks
 
Thomas Fly
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not just try it yourself? Find another PC to install it on, if you need to.
If you can't follow your own instructions and make it work, then you're not ready to upload the assignment!
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sandra,
You should avoid requiring any environmental setup by the assessor at all costs. How do you tell him to set the CLASSPATH? Do you show how to do it in Unix C-shell, Unix Bourne shell, on Windows 98, Windows 2000, Linux? Well you get the point.
To avoid having to set the CLASSPATH you should create executable jar files for both client and server. All dependant classes should be in those jars so that the CLASSPATH won't matter.
Hope this helps,
Michael Morris
 
Gurpreet Saini
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi morris,
As my client needs some files from db pack as well as my server needs files from db pack. So, you say to wrap up the respective files in thier respective exe jars , such that classpath does not bother. Am I right ?.
Thank you,
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gurpreet,

As my client needs some files from db pack as well as my server needs files from db pack. So, you say to wrap up the respective files in thier respective exe jars , such that classpath does not bother. Am I right ?.

Yep. Just put everything you need in both jars. As a matter of fact, except for the manifest file, my client and server jars were identical.
Hope this helps,
Michael Morris
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic