Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Classpath and Path -  Looking for Mr or Ms Clear Explanation

Posted on 2002-03-26
7
Medium Priority
?
201 Views
Last Modified: 2012-05-04
Hi,
What is the difference between the path and classpath? I am trying use Choice.exe from the windows resource kit,in a batch file and I want to add it to the path classpath. Which one and why? Thank you,
diek
0
Comment
Question by:diek_nf
  • 3
  • 2
  • 2
7 Comments
 
LVL 3

Accepted Solution

by:
lpenrod earned 600 total points
ID: 6898286
CLASSPATH is the environmental variable defined for the Java run-time system. Java run-time system is looking for class file in the directories which you included in the CLASSPATH.  PATH variable is separate from CLASSPATH. Your system is looking for executable files in the directories that are in PATH variable.

You can set either of them in a batch file using sytax similar to below:

PATH=c:\path\i\want\to\add;%PATH%

OR

CLASSPATH=c:\path\i\want\to\add;%CLASSPATH%
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 6898455
Hi diek_nf. You can also do it this way. Open My Computer > Properties > Advanced > Enviroment Variables. You will see two lists "User Variables for ..." and "System Variables". Under each you should see in the list "PATH" double click it from the list you want to add the path. Note there are probably several paths already listed. First see if the path you want to list is already listed. Second if it is not then add the path starting with the semicolon ; and then the path at the end of the path line.

Here is a samplie of my System Variables Path

C:\DEVELO~2\Delphi\DELPHI~2\Projects\Bpl;C:\DEVELO~2\Delphi\DELPHI~2\Bin;C:\Development\Delphi\DELPHI~1\Projects\Bpl;C:\Gblware\sqlany;C:\Development\Delphi\DELPHI~1\Bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Support Tools\


The Crazy One
0
 

Author Comment

by:diek_nf
ID: 6899051
Guys,
Thanks. Just a little background, I am somewhere between beginner and advanced in NT knowledge. NT is an everyday learning experience, knowledge gained in part by this site. So....

Ipenrod,
Is classpath only used in java? I had Oracle installed, and I seem to recall seeing that in the Classpath.

Guys,
So if I want programs to be available at the command prompt, i have to add them to the path variable? Crazy for example has C:\Program Files\Support Tools\. To house his favorite command line utilities???

I look fwd to hearing back fro u guys,
diek
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 44

Expert Comment

by:CrazyOne
ID: 6899090
>>>So if I want programs to be available at the command prompt

In a manner of speaking. All this really does is let you enter the name of the exe of bat or com file to run instead having to enter the enitre path from the command line. Lets say you put your choice.exe in the C:\Program Files\Support Tools\. Now you get to a commmand prompt and type in choice.exe then this should run the exe. Otherwise you would have to enter it this way C:\Program Files\Support Tools\choice.exe.    
0
 
LVL 3

Expert Comment

by:lpenrod
ID: 6899094
I am only familiar with classpath in the context of java.  It is entirely possible that it is used for anything that wants to.

Yes, if you try to launch an executable from the command line, the system looks for it first in the current directory and if it can not be found there, then the path is searched.  Some windows based apps also use the path to search for program components such as dlls, etc...

Yes, if you put command line utilities in C:\Program Files\Support Tools and also add that path to your PATH, then you will always be able to run them from the command line regardless of your current directory.
0
 

Author Comment

by:diek_nf
ID: 6899114
I,
Thanks.

Crazyman,
I said it first. I do like your idea of creating a support tools folder. thanks,

diek
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 6899130
Its funny but somthing else I installed created the Support tools folder. I think it had something to do with MS reskit of Support kit. :>)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month6 days, 17 hours left to enroll

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question