Does the subwoofer have to be on the floor?

I plan on putting a home theater in my library. Ideally I would like to place the sub on the bottom most shelf of a cabinet, since all my walls are covered by shelves/cabinets. Also, the bottom most shelf still has two draws below it, would that interfere with the sound? The shelves and draws are very solid cherry wood.
It certainly will with drowers!
All I can suggest is to remove drowers and put sub in that space standing on floor as far as my imagination allows to picture your library.
I can remove drawers, but I will still have a shelf underneath that I cannot remove. For that matter, I think there is some hollow space between the shelf and floor. Would simply removing the drawers be good enough? I do not understand what the big deal is anyway. Regular speakers can have stands, why can't the bottom shelf, which is very solid, act like a speaker stand?
...the hollow space is not a big deal and you can use it, but since sub has a large flexibility of placement i.e. can be realy away from the mains or somewhere in the middle of room or under the journal table or even under your desk.
Its usually bad to put a sub in any cabinet. Just like it can be a problem putting a sub in a corner. Not only will it shake what's on the shelves, you will get resonance problems (you are putting it into another box). The only way around that is with an equalizer.
Can you put the sub on top of the cabinet? It may be more open up there?
Some subwoofers are designed to be placed close to the floor so that floor reflections can reinforce their volume. I suppose you could adjust the volume control to compensate.

A proper location for the subwoofer would minimize excitation of room resonances. Most installations achieve this through either a room resonance calculation or trial-and-error -- moving the subwoofer around the room and listening for resonance excitation. A location selected based on decor considerations would be appropriate only through coincidence.

The support structure may have a resonant frequency within the range of the subwoofer's operation. This could cause sound coloration, as well as potentially disastrous destabilization of the structure and/or its contents. To your point, most speaker stands are designed to have their characteristic resonances out of the speaker's normal operating range, or the stands are so overbuilt that they remain resistant to excitation by the speaker. Perhaps your cherry shelves are likewise sturdy.

I have subwoofers in enclosures in two of my setups. In one, the subwoofer is on the bottom of a very solid wooden cabinet, open in the front. Since the subwoofer has two sidefiring radiators, I need to leave a good amount of space on either side of it or I can hear some coloration. I haven't had a problem with vibrational stability for the cabinet or its contents. The other subwoofer is on a built-in bookshelf. On occasion, I can hear something rattling on one of the shelves. I have hunted down most of my rattles and padded them away. Needless to say, neither of these is really recommended in an audiophile context. I'm not proud.

My key goals are to be able to enjoy the low notes at volume and to blend the subwoofer range in with that of the other speakers. The latter is difficult to achieve, and the more constraints placed on the subwoofer, e.g., limitations on locational flexibility, the harder it is to attain. Good luck.
You should look at building a passive sub into the cabinet and amplify it exteranally. Use Liquid Nails on all screws when you put it together.

I had my sub on a brick fireplace 5" elevation and it sounded aweful (lack of energy) it was a VMP with a Slot loaded passive (probably part of the problem)

Another option
Agree with Elevik. The sub will vibrate everything on the shelves and make every door rattle. Try your best to de-couple the sub from the cabinetry. The bottom shelf might work ok for your needs. All you can do is test and see. If there is space around the sub in the cabinet, you may need to add some foam.
Sounds like most of the problems people mention relate to things rattling. If you play the right kind of music, and your SW is up to it, things are going to rattle and shake wherever the SW is placed in the room! But, with patience, you can track each rattle down, and kill most of them.

As to height above the floor, I have just designed and built a SW system (3 of them to go with 3 front speakers) that is a bit out of the ordinary, but which I find very satisfactory.
My speakers are Magnepans, so I wanted a large radiating area of SW drivers, lightly driven, and I wanted them to sort of "play through" the screens. What I have (behind each MG1.6) is a vertical stack of a 12" Dayton Titanic SW driver and, on top, a 15" JBL LE15A LF driver. The center of this array is about 45 inches above the floor: nearly centered on the Magnepans. Crossover is 90Hz 24 dB. Accoustic foam covers the fronts of the SW enclosures except where the drivers are. (Good for the magnepan backwave).
I already had the JBL drivers, so the whole 3 set system, including lumber for the 7 cu ft enclosures buried in the wall, and three SW amps, cost less that what I was thinking of spending on a single Velodyne SW. Now the Velodyne is remarkable, but there is no getting away from the fact that it's only one 12" cone, driven very hard. I attribute the success of my design to the large cone area and the fact that it is off the floor.