Not ordinarily kept in glass jars (although if you wanted to keep track of yours, it might not be a bad idea), Bandai's Hex Bug robotic toys spend their time skittering around on level surfaces blindly following their limited programming. Just like real bugs.
They're interactive, too. Clap your hands and they change direction. When they bump into each other, or something else, they change direction, too.
(Bandai Hex Bug youtube video)
For myself, I never look at these toys without thinking of their literary ancestors - like the robotic scarab beetle from Raymond Z. Gallun's classic 1936 short story The Scarab:
The Scarab rubbed its hind legs together, as flies will do when at rest. Then, apparently satisfied that it was in condition, it unfolded the coleoptera-like plates over its wings. With a buzz that any uninformed person would have mistaken for that of a beetle, it started out on its journey.
(Read more about scarab robot insect)
Robotic insects are all the rage with researchers; see these articles for more: