Reindex Java API in 5.6.3

Sorry for not being clear. Forget java code. I want to migrate from 1.* to 5.6.3 elasticsearch. I cant afford having another elasticsearch box as mentioned in " reindex-from-remote " here. Is there any other way for direct migration?