Solved

Classpath and Path -  Looking for Mr or Ms Clear Explanation

Posted on 2002-03-26
7
193 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

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…
This article is in regards to the Cisco QSFP-4SFP10G-CU1M cables, which are designed to uplink/downlink 40GB ports to 10GB SFP ports. I recently experienced this and found very little configuration documentation on how these are supposed to be confi…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

636 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