An earthquake of 5.7 magnitude struck near the Indonesian island of Java on Tuesday at a depth of 138 km (85.7 miles), the European-Mediterranean Seismological Centre reported.