peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
Hey
I want to create a JAR library but not sure how to in MyEclipse. Im currently doing it manually using jar command but I cant seem to get it correctly
The library code is:
public class LibAdd
{
public static int addtwonumbers (int a,int b)
{
return a+b;
}
}
From this, I generate the .JAR (using what command in case Im doing it wrong). Named (for example) LibAdd.jar
Then in another project, in the build path, I include the LibAdd.jar and I want to do this:
public class AnotherClass
{
public static void main(String[] args)
{
LibAdd l=new LibAdd(); //Can I do this,having no main???
int x=l.addtwonumbers(2,3);
System.println.out(x);
//OR
System.println.out(l.addtwonumbers(8,5);
}
}
Thanks for the help :)
hmm maybe this could help: http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftasks-33.htm . lol sorry peter_budo. haha we used the same thing :)
DavidKroukamp
Practically a Master Poster
693 posts since Dec 2011
Reputation Points: 282
Solved Threads: 169