Solved

How to set jar files in classpath

Posted on 2013-05-11
5
414 Views
Last Modified: 2013-05-12
Hi there,

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

Thanks a lot.
0
Comment
Question by:zizi21
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 7

Expert Comment

by:jax79sg
ID: 39158893
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

Or,

When you run the java code.
java -classpath myfolder/jar1.jar myapp.main
0
 

Author Comment

by:zizi21
ID: 39159094
But when i compile the code, shouldn't i add the jar files as well? Thanks so much.
0
 
LVL 7

Accepted Solution

by:
jax79sg earned 500 total points
ID: 39159148
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.
0
 

Author Comment

by:zizi21
ID: 39159158
let me install eclipse now ....
0
 

Author Closing Comment

by:zizi21
ID: 39159183
thanks a lot
0

Featured Post

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question