A New Jersey municipal judge who is also an established stand-up comedian and actor resigned on Thursday after the State Supreme Court ruled he cannot moonlight as an entertainer.

The judge, Vince A. Sicari, said he tendered his resignation after the court released a unanimous opinion that said his acting and comedy career was “incompatible” with judicial conduct codes and essentially gave him the choice of doing one or the other.