Position the bookcase on the floor approximately one inch away from the baseboard of the wall.
Push the top of the empty bookcase back toward the wall and insert the proper size shim under the corner. The shim should be big enough to hold the bookcase up against the wall without protruding out from under the edge of the bookcase. A shim is a slim wedge of wood available in many sizes.
Hammer the shim in under the bookcase toward the wall until it is even with the edge of the bookcase.
Repeat the process on the other side of the bookcase. Both sides of the bookcase must be tilting back against the wall so its weight is distributed evenly and straight down on the shims to hold them in place.