Do NOT get married by a judge, you need marital counseling and support of a priest. I am twice divorced and can tell you marriage should be in a Catholic Church by a priest if you are Catholic unless special dispensations are granted. You cannot take communion if you are married outside the faith.
You CAN get married if you are together, but there are very strict guidelines. Most priests would much rather see a couple married than deny them marriage and have them continue to live together. You did not say if this was the case, but GO TO A PRIEST, be honest and he will help you with your particular circumstance. I am shocked at the rudeness of some people on here. I wonder how the prodigal son would have been treated if he posted his situation and asked about “coming home”. Show some compassion. Yes sin is bad, and yes mortal sin can damn a soul to hell, but invite someone to come home, don’t tell them how ignorant they are or call them a liar when they say they didn’t know something. Case in point: I had a priest tell me when I became Catholic in 2000 that masturbation was fine, just don’t have sex. So I got addicted to it. When I came home to the church last year I told the priest that I wasn’t worried about being divorced when it came to sex as “some things were still allowed” and he asked me what I meant. I told him what the other priest (who’d been a priest for over 25 years) told me. He then showed me in the Catechism it was wrong. I’d never seen or heard of that book until then and I went to RCIA for 9 months. I was shocked. I honestly did not know it was a mortal sin. I figured it was OK because the priest actually stood in front of me and told me it was. He knew I was living with a guy when I became Catholic and told me, “Now that you’ve had Confession don’t sleep with your boyfriend before your first communion this Saturday.” How’s that for information? Please stop bashing people about what they SHOULD know, sometimes we are steered wrong.