Add java call to check two versions.

Return methods directly from java instead of odd native callbacks.