I have a similar problem (except it's chocolate instead of candy

) and sugar free gum does really help. The fruity flavors of orbit are my favorite study buddies because they are so good.
Another thing that really helps me is to put one chocolate on my shelf and write something like "Do not open until you know you have studied enough to make an A on this test!!" or something like that. Then I have incentive to study and I satisfy my craving. I also make sure that I only have a small portion out, and I put the rest of the bag on the top shelf of my closet, so that I won't be tempted to eat the whole thing!
Good Luck!