How to set jar files in classpath

Hi there,

Please help. How do i set jar files in classpath?

Thanks a lot.
Who is Participating?

Improve company productivity with a Business Account.Sign Up

jax79sgConnect With a Mentor Commented:
If you did it on the OS level, the compiling would have used them if they are included in the OS CLASSPATH.

I would recommend that you use IDEs such as eclipse.
On Windows you can use following command line. Just append your jar. All java runtimes will refer to this line on top of their own.
set CLASSPATH=myfolder/jar1.jar;myfolder/jar2.jar;myfolder/jar3.jar


When you run the java code.
java -classpath myfolder/jar1.jar myapp.main
zizi21Author Commented:
But when i compile the code, shouldn't i add the jar files as well? Thanks so much.
zizi21Author Commented:
let me install eclipse now ....
zizi21Author Commented:
thanks a lot
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.