From Osaka you can definitely catch a ferry to Naha from Shimonoseki I am not so sure but you can probably find domestic ferries to Osaka and catch one from there to Naha or get to Kagashima and do the same.