If I understand the question correctly, it seems that the program is behaving correctly ... the main thread ends and ends, and the < background thread continues to work. The JVM will not be completed until all non-daemon threads are completed. If you want the JVM process to terminate when the main thread terminates, you need to do as Roman points out and call Thread.setDaemon(boolean) .
However, if the problem is that the main thread terminates correctly, but background never terminates, even if it completed the task you gave it, background blocked.
The best first IMO step is to start the VisualVM process to dump and use its thread debugging tools to find out what background does and why it hung. (You can also force the JVM to dump the stack by sending it kill -QUIT <pid> if on * nix ... there is something similar to windows with the Break key, but I can't remember the specifics.) The stack scene in Java 6 is enough are complex and will indicate possible deadlocks with objects in which each thread is blocked.
VisualVM is just fun to use, so try it if you have never used it.
source share