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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help!!! - HOW & WHERE do I add someone's package into your JDK library 2

Status
Not open for further replies.

qb828

Programmer
Sep 27, 2000
98
US
Hi!

I forgot how to add someone else's packages into your JDK library.

Can you help me?
How and where?

Do I want the binary or source?

Do I just run "jar xvf sample.jar(.zip)?

Thanks


QB
 
If you add the jar files (un-jarred) into %JAVA_HOME%\jre\lib\ext then they will be picked up automatically. Or alternatively put the jar file anywhere, and reference it by name in your CLASSPATH environment variable.
 
Thank you for your helpful post.


QB
 
Hi sedj!

i put my jar files at jre\lib\ext and run the code.
but it didn't find the package.

so i set the classpath to jre\lib\ext and it ran fine.

But it didn't find the other standard packages.
I can't even run Hello.java.

it says noclassDefFound error.

i have two paths set as

path c:\jsdk\bin;
classpath c:\jsdk\jre\lib\ext;

what are the difference of those two?

DO i need both ?

can you explain to me or guide me to some site where i can read about it?

THANKS

QB
 
gb828,
Place the new jar under some other folder and set your class path to point to the jar(not the directory). For example, you can put the sample.jar under c:\temp and set your classpath as,
CLASSPATH=c:\temp\sample.jar

Ganesh
If you find my post really helpful, please record it by clicking the purple star below.
 
Thanks Ganesh!



Another question.
Ok now I set my classpath as c:\jsdk\jre\lib\ext;

and i compile my file like this
javac -classpath c:\jsdk\jre\lib\ext Mytest.java

why do I need to specify the path again above when I set the classpath already?

when I compile without the path it won't do it.
javac -classpath Mytest.java

I don't get this.

THANKS MILLIONS
QB



QB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top