First, change your perspective. As long as you see your boss through your "jerk" filter, your boss will be a jerk. Let that go and see your boss as just your boss. Period. Don't make judgments or put labels on the boss. Realize that your boss just is. Shifting your perspective will help you to begin to shift the energy around how you think and respond to your boss.
Learn to manage your boss. Yes, that is right. One of the most important things one can do is manage the manager. Learn what your boss wants and doesn't want, likes and doesn't like, and how to do the kind of job your boss is looking for. I once worked for a boss that wanted a daily report on everything I did. I thought it was ridiculous, but it made my boss happy and kept him off my back. Remember that you do work for the boss and the boss is paying you, so as long as what the boss is asking for is legal, then it is your job no matter how stupid it may seem to you to do what the boss requests.
Understand that your boss is not going to change. I have worked with clients that think that if they just do their job better, faster, or more elegantly, the boss will see how valuable they are and change their evil ways. Ha, in your dreams! The boss is not going to change. If change is going to happen, it is going to be up to you. You will have to change the way you interact with your boss. Once you begin to act differently, the boss may respond differently, or not, but it will be up to you to make the change and you will be in control of your own actions and responses.
Know that it does not matter if you like your boss. You do not have to be best friends with the boss. You do, however, have to have a professional relationship. That means that you do not complain or gossip about your boss and you get your job done. I have worked with bosses that I could not stand, but they never knew it. I was polite, respectful, and did my job. It was not always easy, but it made a difficult situation tolerable.
Understand that you have a few choices here. You can stay and live with it or you can leave. You can either adapt to the situation or leave the situation. If you feel like the boss has done something illegal, you can always see a lawyer and find out what your rights are. You might also talk to someone in your Human Resource Department or the Equal Employment Opportunity person in your company. The thing to remember is that you are never powerless. Even if all you can do is control your own actions and attitudes, remember you are in control.
Document everything. Documentation will support you if you ever have to file a complaint. Keep detailed records about the interactions with your boss, the work you are doing, and anything else that may seem important. I once had a boss try to downgrade my appraisal for no other reason than his appraisal had been downgraded and he didn't want me to have a better rating than he. Because I had everything documented, I was able to fight the downgrade and won.
Documenting what you do just makes good sense. It will also help you at the end of the year when you are trying to remember everything you did. Don't expect your boss to remember; even a great boss won't. They have way too much to do. It is up to you to keep detailed records of how you are contributing to the organization.
Everyone is someone's difficult person. You may very well have a personality conflict with your boss. Ask yourself honestly how you are contributing to the relationship with your boss. It does take two to dance. Ask yourself how you are making things worse. This can be hard to look at, but can also give you some insight into your own behavior and how you can remove yourself from the drama. Sometimes, with or without realizing it, we are making the situation worse. Step back and see how you might be doing that and stop. This isn't a matter of giving up or letting the other person win. It is a matter of maintaining your sanity.
Find someone outside of your work environment to talk with. Do not talk with other people at work about what a jerk the boss is. It will get back to her or him. Find someone who can give you an unbiased opinion and help you create a strategy to manage the boss. This will help you to defuse some of your frustration and support you in creating healthy ways to handle the situation.
And remember, you have the power! Don't let anyone take it from you. Control your actions and attitudes. As long as you are in control, you are better able to manage the situation and make the best choices.