First and foremost, avoid blaming yourself. It is not your fault. Place the blame where it belongs - on the harasser. Self-blame may cause depression, and will not help you or the situation.
If you do decide to make your concerns known to the harasser and feel safe in doing so, some sources suggest that you send a letter, by certified mail. Give the person a factual statement of what has occurred ("Last week when we were waiting for class to start, you told several dirty jokes") and your feelings about those events ("I was very upset; I felt humiliated and offended").
State explicitly what you want to happen next ("Please do not tell dirty jokes in class; I want to be treated with respect, not as a sex object"). You do not necessarily have to use the words "sexual harassment." The letter should not call for any discussion or explanation on the harasser's part; you are simply asking in a very civil tone for the behavior to stop.
Because at this point you are trying to achieve a change in behavior without being perceived as threatening, do not copy anyone else initially. Do keep a copy of your letter in case your efforts do not effect positive change and you need to seek assistance to deal with the harassment.
Even if you don't want to file a formal complaint, there are some actions the University can take to address the harassment -- but we can't act unless we know about the problem.
Note that university personnel have a duty to report discrimination. If you are concerned about confidentiality, be sure to ask the person whether you can speak to them in confidence and what action, if any, they are required to take after they talk to you.