They are air breathers, and need easy access to the surface, which means they need a tank that is LONG, not tall. So a jar simply isn't going to do it.
As a temporary solution, they could live in a Critter Keeper of a gallon, preferably more, as long as you changed out 50% of the water every day or every other day, as needed. Just make sure you keep the lid really secure, and they can reach the surface without any trouble.
It's better than having them die from the Ich medication, which they would surely do, as they are VERY sensitive to any chemicals in their water.