Solved

Classpath and Path -  Looking for Mr or Ms Clear Explanation

Posted on 2002-03-26
7
180 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 150 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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  today’s increasingly digital world, managed service providers (MSPs) fight for their customers’ attention, looking for ways to make them stay and purchase more services. One way to encourage that behavior is to develop a dependable brand of prod…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now