wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Adding .jar file to class path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Adding .jar file to class path" Watch "Adding .jar file to class path" New topic
Author

Adding .jar file to class path

ZEESHAN AZIZ
Ranch Hand

Joined: Jan 15, 2001
Posts: 162
I want to add a file named sdk.jar in classpath. What is the procedure of adding a jar file to classpath.
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Have you consulted the SDK documentation? It clearly tells you how to add things to your classpath. Check it out.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
Moving this to Java in General (Beginner).
[ May 24, 2004: Message edited by: Corey McGlone ]

SCJP Tipline, etc.
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
Originally posted by ZEESHAN AZIZ:
I want to add a file named sdk.jar in classpath. What is the procedure of adding a jar file to classpath.


Are you using Win2k & above? If you're, you'd need to set an environment variable call classpath & add the jar file path to it.


SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
rahil qamar
Greenhorn

Joined: Nov 16, 2000
Posts: 8
Originally posted by ZEESHAN AZIZ:
I want to add a file named sdk.jar in classpath. What is the procedure of adding a jar file to classpath.


Hi

Right click on My computer -->properties-->Advanced-->Environment Variables. Then either create a new CLASSPATH system variable if not already present or simply add the jar file you want by editing the existing CLASSPATH variable. For instance if you want to add the jar file sdk.jar located in C:\Java\lib then add C:\Java\lib\sdk.jar in your CLASSPATH.

To initiate this classpath, close the existing command prompt window and open a new window. The classpath should take effect. You can check this by typing 'set claspath' at the prompt.

Hope this helps.

Rahil



rahil
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
You might like to take a look at our FAQ on HowToSetTheClasspath.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adding .jar file to class path