• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Adding .jar file to class path

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to add a file named sdk.jar in classpath. What is the procedure of adding a jar file to classpath.
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you consulted the SDK documentation? It clearly tells you how to add things to your classpath. Check it out.
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving this to Java in General (Beginner).
[ May 24, 2004: Message edited by: Corey McGlone ]
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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

 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might like to take a look at our FAQ on HowToSetTheClasspath.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic