A moderately strong earthquake has shaken the Indonesian island of Java and the country's capital Jakarta.

There were no immediate reports Tuesday of damage or injuries.

According to the U.S. Geological Service, the 6.0 magnitude quake was centered offshore western Java at a depth of about 43 kilometers (27 miles).

According to Indonesia's Department of Meteorology, Climate and Geophysics, the quake didn't have the potential to generate a tsunami and no warning was issued.

Buildings in the capital swayed for 10 to 20 seconds.