The local meteorology, climatology and geophysics agency said there was no tsunami alert.
A disaster management official in Cilacap said so far there was no report of damage from the area although it had caused panic.
“When the quake hit, we felt a strong tremor. Many people ran outside their houses,” said the official, named Suherman.
“Now the disaster management officials are trying to calm people here, saying there is no threat of a tsunami.”
Indonesia sits on the Pacific ring of fire, where the meeting of continental plates causes high seismic activity and is frequently hit by earthquakes.