My jaw hurts when I open my mouth, it’s been hurting for about a year
There can be many resons for your pain. You may be grinding your teeth when you sleep making your jaw hurt. You also may have TMJ. Some of the systoms of TMJ is jaw pain, and craking poping sounds. Either way I would check with your dentist and see what they advise.