I am trying to run an application that uses an external library and I believe I have something missing in my setup. My project structure has the source code in the src directory, external libraries in lib and the resultant build in the bin directory. I have for purposes of this, just 2 files. The first one is in the src directory:
import decorations.*;
public class Christmas {
public static void main(String[] args) {
ChristmasBall xmas = new ChristmasBall("Happy Holidays");
ChristmasBall blah = new ChristmasBall("merry Christmas");
System.out.println(xmas.toString());
System.out.println(blah.toString());
}
}
The second file is in the lib folder of the project.
package decorations;
public class ChristmasBall {
private String merry;
public ChristmasBall(String message) {
merry = message;
}
public String toString() {
return merry;
}
}
Its zipped up using the command from the lib directory: jar -cvf xmas.jar ChristmasBall.class
I get the following results:
added manifest
adding: ChristmasBall.class(in = 361) (out= 250)(deflated 30%)
Then I try to compile it and get the error that package decorations does not exist while using this command:
javac -Xlint -d ..\bin Christmas.java -cp ..\lib\xmas.jar
What am I missing?