The TMJ is a ball-and-socket joint located where the upper and lower jaws meet. The TMJ and its nearby muscles make up a complex system. A problem in one part of the system can affect the other parts. This can cause you to have temporomandibular disorder (TMD).