If you really need it, perhaps consider setting up a Jail and using an older FreeBSD package release.
For example, in here:
http://pkg.freebsd.org/FreeBSD:12:amd64/
You will see:
release_0/
release_1/
release_2/
Perhaps try the oldest release_0. And finally if that doesn't work, even consider running an older FreeBSD (i.e 11) in that Jail. This is not ideal but if upstream drops software and you *really* need it, you kinda have to keep running it on the last legacy system they support. Or of course shed the dependency and find something lighter, more portable and easier to maintain. Of which is probably not Java