first try disassembling it, cleaning it really good, then oiling it. The first time mine acted up, that fixed it. If it still acts up, the gun needs a new SLIDE. Mine is at the point, it needs a new slide.
The slides on J22's are soft aluminum alloy, eventually the bolt face of the slide gets worn and pounded in from the hardened barrel breach, and starts having feeding/extracting/ejecting problems. What happens is, the slide starts moving to far forward when closed, and the extractor is forced outward to the right, disengaging the case head rim.
Then it doesn't extract. The force of firing may blow the empty shell out of the chamber and backward, but it sits inside the gun or stovepipes, and jams the gun, because it doesn't hit the ejector rod squarely.
If you change the slide, change the extractor claw too. Save the old stuff for comparison.
You can buy them at Numrich online. The slide is about $25, the extractor around $4.
For $35 the J22 will be shooting again. But keep in mind, the slides on those guns are totally sacrificial, i.e. the more you should them, the faster the slide wears out and has to be replaced. The slide starts to bow on the right side, and the snout of the slide starts to bend upward slightly, as they get worn. That's how bad my J22 is now, after about 2000 rounds.
if the slide was hardened steel, they'd last forever. But then they'd be a $300 gun, instead of the $75 gun they were new.
They are worth fixing because for a short barrel 22, they are quite accurate, and a handy little pocket gun. Just don't carry one with a shell in the chamber. I carry one while fishing, loaded with shotshells, for snakes. It's like a little shotgun.
The previous warning about closing up headspace on a worn early slide, is CRITICAL. I have one that experienced that problem. I had 2 slam fires just chambering a round from a fresh clip, fortunately the gun was pointed in safe direction both times, by instinct and habit, and the bullets just went in the ground. I also had a few CHAIN FIRES i.e. 2 or 3 shots going off from one trigger pull, because the closing up of headspace causes the gun to slam-fire. To clarify, the bolt face begins to wear, and the flat distorted bolt face, fires a fresh round upon chambering it, without the firing pin.
Another mistake made with these guns, is using a stronger slide spring. That makes the slide slam forward even harder, wearing it out sooner, and making the risk of a dangerous slam fire even more likely. Use the weakest slide spring you can, that will still make the gun function. A weaker slide spring, will allow shooting lower velocity ammo, and be easier on the relatively soft alloy slide.
FWIW, my Jennings has s/n 500,xxx range and still had the defects, and slam fires/chain fires. A new slide will fix the problem, but being soft aluminum alloy, eventually the new slide will also wear. The new slide will just last longer than the old slide did pre-70,xxx serial number. I have heard stories of the old slides starting to malfunction after only 50 rounds, i.e. one box of ammo.
A good approach for these guns would be, start with headspace on the high side- as the headspace closes up with slide/bolt face wear, rather than opening up like most other guns do.