Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to set classpath ?

Status
Not open for further replies.

haux

Programmer
Joined
Apr 11, 2001
Messages
79
Location
DZ
I have Win NT4 SP5 i have in my autoexec.bat the only line :
SET PATH=c:\jdk1.2\bin

so when i type c:\path
i get PATH=C:\WINNT\system32;C:\WINNT;c:\jdk1.2\bin

OK to use commapi i must change the classpath...when i add to autoexec then line
SET CLASSPATH=c:\commapi\comm.jar;%classpath%

and when i restart my PC, and type c:\classpath
the commande is not recognised !!!

can someone help me ?
 
Try this:
Right click "My Computer."
Click on the "Environment" tab
You should now see the Systems Variables and the User variables.
Click on whichever box you want the new variable to be in. If you are going to modify a variable, click on that variable.
If adding a new variable, type it name in the "Variable" edit box. Then type in the path in the "Value" box.
If you are modifying an exiting value, go to the end of the value in the "Value" box and add your path.
For example, if CLASSPATH do not exist, type in CLASSPATH in the "Variable" box. Then type in c:\commapi\comm.jar;%classpath% in the "Value" box.

James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
 
i have done what you suggest 2ffa. But i still have problem because :

i have add c:\jdk1.2\bin to my environnement path OK
i restart the pc and all my java programme runed without problem
but when i have add the variable:

variable: CLASSPATH
value: c:\commapi\comm.jar;%CLASSPATH%

and after restarting my PC when i execute any java program i get :


c:\java Myprog
Exception in thraed "main" java.langNoClassDefFoundError: Myprog


i still wondering !!!!!
is there some other things i must do ?!!!!
 
Try this:

variable:[tab]CLASSPATH
value:[tab]C:\jdk1.2\bin;C:\commapi\comm.jar

variable:[tab]PATH
value:[tab]same as the existing but add;%CLASSPATH%

The way you've defined CLASSPATH, it only has the commapi then calls itself again.

James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top