Error Accessing Methods in My JAR file

Hello,

PLease help me, I'm trying to add MY jar file to my java application and I'm trying to access the class this way.

1) I had an import of the class I want to access.
2) I create an instance of that that class and try to access the method inside the class, but Eclipse keeps giving the following errors as if it doesn't see the methods in the class...

Did you wrap your calls in a main method? You will get this error if you didn't, meaning do this:

Java Code:

public static void main(String[] args)
{
helloWorld hw = new helloWorld(); //class names should be capitalized...fyi
hw.subtract(3,4); //you do realize you are calling a static method from an instance...this will work but bad practice
hw.getStr();
hw.subtract2(6,7);
}

public static void main(String[] args)
{
helloWorld hw = new helloWorld(); //class names should be capitalized...fyi
avu: Yeah, I realized that after but I was just testing quickly so didn't pay attention to convention. :o

hw.subtract(3,4); //you do realize you are calling a static method from an instance...this will work but bad practice
avu: sorry why is this bad practise? Excuse my ignorance here.

hw.getStr();
hw.subtract2(6,7);
}

I didn't put it in a main method because we didn't need a main method.

Is there any other way to get around it without a main method?
The code in the jar was packaged so that we can reused that jar without having to access the source code.

Can you provide the complete code for your test class/method that is using the code from the jar file, even the package and include statements, just copy paste it in here so we can see exactly what you are doing.

I figured it out. You were on the right track when you said I had to put my code into the a main method. Well, I didn't need a main method but I put those code into a method and it works. Before i just had....