You need to make sure the server itself cannot be GCed (such as making the reference a Class object).
Not a problem in this case.
Reachable objects are determined from Threads, it a
Thread is executing the accept() method the objects defined inside the main method have references on the stack and are reachable.
Bill