The earthquake, which had a magnitude of 7.2, struck at 15:19 local time (0819 GMT), officials said.
Tremors were felt for more than one minute, but there were no immediate reports of damage or casualties.
The Pacific Tsunami Warning Center said there was no threat of a widespread destructive tsunami, Reuters reported.
But the Hawaii-based agency issued tsunami warnings for parts of Indonesia and Australia, and the Japan Meteorological Agency also warned of localised tsunamis.
The areas that could be affected were the Indonesian islands of Java and Sumatra, and Australia's Christmas and Cocos islands, the Pacific Tsunami Warning Center said.
The epicentre of the earthquake was in the sea off Pangandaran, south-east of Jakarta, an official from Indonesia's seismology centre said.
Earthquakes occur frequently in Indonesia, which sits on the seismically active so-called Pacific Rim of Fire.
On May 27, a magnitude 6.3 earthquake hit near the city of Yogyakarta in Java, killing more than 5,800 people.Güncelleme Tarihi: 20 Eylül 2018, 18:16