trivial third party jar dependancy
I googled a bit but didn't find anything trivial. I have a "hello
world" which happens to do a randomly-chosen calculation. What I would
like to throw into the mix is a third party jar of some sort so that
HelloFibonacci.jar has a dependancy on this third party jar to do
something.
I'm not sure what the something is, but it should be trivial. This is
strictly to work on packaging rather than anything else at the
moment.
What would be a simple sort of jar file to include in the compiling and
building process, which I could then utilize? Perhaps instantiate
something from this third party jar, something along those lines --
nothing complex.
thufir@arrakis:~/java$
thufir@arrakis:~/java$ java -jar build/HelloFibonacci.jar
Hello World!
the fibonacci of 9 is: 34
thufir@arrakis:~/java$
thufir@arrakis:~/java$ cat src/thufir/sun/hello/HelloWorldApp.java
package thufir.sun.hello;
import thufir.math.Calculations;
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("\nHello World!");
System.out.print("the fibonacci of 9 is:\t\t");
System.out.print(Calculations.fibonacci(9));
System.out.print("\n\n\n");
}
}
thufir@arrakis:~/java$
thufir@arrakis:~/java$ cat src/thufir/math/Calculations.java
package thufir.math;
//should be an abstract class
public class Calculations {
public static int fibonacci(int n) {
if (n <= 2)
return 1;
else
return fibonacci(n - 1) + fibonacci(n - 2);
}
}
thufir@arrakis:~/java$
thufir@arrakis:~/java$
thanks,
thufir