Think about what's the purpose of starting with humor: a useful rule in teaching is that you need to pick up students where they are now. You have to engage them by attaching to something that is already on their mind or that they already know about, and then you can gently lead them towards what you want to teach. Also, if you manage to create emotions in students during a lecture, they are more likely to remember also the academic content.
So humor in a class can serve two ways: To link the content of your lecture to students' everyday lives, and to engage them emotionally. To achieve this, you should pick jokes that in fact link everyday things to the content of your lecture. For example, in a class on research methods I once taught, I started each lecture with a strip of PhD comics that fitted to the topic of the lecture. Also earthling's answer has a nice example how to relate students' everyday live to a programming topic.
Also, if you can't come up with a suitable joke, don't worry: there are a lot of other ways to achieve the same purpose. For example, you could link to a recent story in the news, local events on campus, or in fact anything that most students are aware of and that you can somehow link to the content of your class. For example, already some years ago, Mercedes had problems with cars falling over in zigzag driving tests. That would make a nice start for a lecture about vehicle dynamics: "Today we are going to learn how to avoid this..."
Concerning the emotions, humor creates fun, which is a good emotion to help remember things. Think of other emotions, and how you could create them in a class.