finalize() is always called before an object is garbage-collected. The thing is that there is absolutely no guarantee that any particular object will ever be collected. Objects are garbage-collected only when the JVM needs to reuse their memory. This means that finalize() is not an especially good way to reclaim resources. Although the finalize() method isn't deprecated, it might as well be, because it has no truly useful purpose.
In general, if a Java object is a proxy for some native resource, then what
you should do is give that class a public method named dispose(), and make it a requirement that clients of that class call dispose() when they are through with the object.