• Post Reply Bookmark Topic Watch Topic
  • New Topic

Adding .jar file to class path  RSS feed

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
You might like to take a look at our FAQ on HowToSetTheClasspath.
 
Water! People swim in water! Even tiny ads swim in water:
The WEB SERVICES and JAX-RS Course
https://coderanch.com/t/690789/WEB-SERVICES-JAX-RS
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!