A magnitude-6.1 earthquake struck off the coast of Okinawa Prefecture on Thursday night, according to the Japan Meteorological Agency (JMA).