My question involves a roommate in the State of: New Jersey

Recently, we co-signed a two year lease in a multidwelling. My roommate wishes to leave and be released from his financial obligation to pay rent.

If I don't find a replacement roommate in time, I'd have to pay the entire rent, which I cannot afford...I'd have to go into debt. I assume I could then take my ex-roommate to small claims court.

Or, what would be the consequences to me if I paid only my half of the rent?

What is my best course of action to protect myself legally? I do not want to lose this apartment.

Thank you.