Java doesn't have any concept of native pointer, so storing it as a long is the only real option. But you should not rely on finalize to free the pointer; the finalize method is unreliable as a means of cleaning up resources. See this question for further details.