The quake was felt strongly in Denpasar, the capital of Bali, but there were no reports of injury or casualty on the resort island. Earlier, at 0555 GMT, a 5.2-magnitude quake struck 43 kilometres south of Bandung, the capital of West Java, the Meteorology and Geophysics Agency said.
District spokesman Suherman said several people were injured in the melee and many houses were damaged but the number was not immediately known.
Police said hundreds of residents in Garut in West Java took to the streets to protest drilling work for a steam turbine power plant which they said caused the earthquake.
"I'm trying to convince them that the earthquake was not caused by the drilling," Garut police spokesman Commissioner Edi Haryanto said.
A 9.0 earthquake off Indonesia's Sumatra island on December 26 produced tsunamis that left about 280,000 people missing or dead around the Indian Ocean.
A 6.2 earthquake jolted the town of Palu on Sulawesi island on January 24, damaging dozens of homes and prompting thousands to flee to higher ground fearing more tsunamis.