Also, there's usually other stuff going on in a courthouse aside from jury duty. For example, there's family law and other offices that you could say you have an appointment there. The key is to just look respectable (clean haircut, nice clothes, nice watch) and confidently state where you're headed. Besides, it's a public building, it's not like it's some secured facility that's illegal to enter.
If you're unsure just google your local courthouse and see if there's anywhere to make appointments, or at the very least see which offices are in there. Then go to the courthouse and if they ask for a reason say you're there to visit soandso (the name/office you got on the website). The worse they can say is no.
Jury Duty = judges and lawyers and important people, so restricted access
DMV = only peons work there, so you can walk right in