Ok, with a really persistent jerk who's not good at respecting boundaries...
(My litmus test to see if they're one of those jerks is to take a time out and bluntly inform them: "Ok. Seriously. I have a boyfriend who I love very much. I'm not interested in you, and honestly, you're making me uncomfortable. Please stop." Be firm! At this point, any decent guy should back off, and he'll probably apologize. If he does, you can apologize for coming off bitchy, and explain you just wanted to be clear, blah blah, and everything is smoothed over. If he doesn't, he's a persistent jerk and needs more extreme measures.)
So...
Being nice doesn't work. In his mind, that means he has a chance. He'll either think you like him, or he can wear you down until you cave.
Being a bitch doesn't work. He'll take this as a challenge. He'll think you're flirting with him, b/c you keep responding. (Like you know how it's almost fun sometimes to keep throwing witty insults/denials at them and they keep responding? And how it almost feels like flirty banter? Yeah... that's his goal.)
Best thing to do is ignore him. If you still want to be nice (like if he's in your social group or w/e and you don't want to cause drama), just give him as little to work with as possible. If you have to respond, give
kinda bitchy answers (the ideal are those that would leave him wondering if that was an insult or not, yknow?), and/or very very brief/boring/neutral ones. Act as profoundly bored as you can. Mention your boyfriend.
examples...
1) him: "You can't have a friend?" you: "Of course I can. That's why I already have friends." *insincere smile*
Then walk away (to bathroom or drinks or a friend if you're out somewhere), say you forgot you had to call your boyf back if it's on the phone, etc.
2) if he's trying to be friendly at a party, or after class or w/e, be really terse...
him: "How are you?" you: "Ok..." him: "Want a drink?" you: "No." him: "You look really pretty." you: "Thanks, I have to go though." him: "Want to study together later?" you: "No, I'm set." etc
If it's just some random dude, I usually say my retort and turn away (I'm braver if I've been drinking, haha). Or even, half-assed close-lipped smile and turn away. That works pretty well, b/c they don't really have anything they can hook onto to be persistent.
Whew that was long. Based on lots of trial and error on my part!