I will typically begin craving junk foods anytime during the day where I find myself bored and not having much to do. The simplest solution that I have found works for me is to simply not carry junk foods inside my home. I keep my fridge well stocked with apples and other light snacks such as gelatin and light cheese. If I do get a craving, I limit myself to a single snack (satisfies my craving).
My boyfriend likes to munch on snacks (candy, chips, etc). We came up with an agreement that he could eat those snacks so long as he kept them in the trunk of his car and ate them when I am not around. Our compromise has worked well; I haven't craved the junk because I don't physically see it, and I enjoy digging into one of my alternative snacks! He hasn't complained about having to eat that stuff behind my back