That big block of code that you have that is not part of main and so it is never called. You must be either 1) put into main, or 2) put into a function that is called from main.
Right now you just have code hanging out in space and you are not calling it.
perhaps toss this around it for starters:
private static void foo(){
// stick block of code in here
}
then call it from main like this:
public static void main(String [] args){
foo();
}