Basically I wish to use the methods of a class within the Jar file, which looks like this:

Can somebody please tell me what I need to import in order to use those methods and variables?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You don’t need to import anything.
Jar files aren’t imported, they are added to the classpath.
From the screenshot you’ve posted, we can see that the
myJar.jarfile is included in your eclipse classpath, so there’s nothing more to do there.Classes are imported, if they are in a different package.
Your
Examplewclass is in the default package.BMIcalculatoris also in the default package. Because they are the same package, you don’t need to import it.You should be able to simply make references to
BMIcalculatorfrom withinExamplew. Just try it.Try compiling this code – it should work:
You might get warnings about the unused private field, but you can ignore that for now.
If that doesn’t work for you, then please post the error, because it doesn’t look like the problem is with your imports (or your classpath)