Solved

How to set jar files in classpath

Posted on 2013-05-11
5
406 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
  • 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This video teaches viewers about errors in exception handling.

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now