Solved

How to set jar files in classpath

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Apps blocked by Java 9 88
xampp tool 12 56
fibonacci ten numbers 4 46
even odd program using while loop 3 60
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
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…

820 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