I am afraid this is a shortcoming of macOS Big Sur which breaks all kinds of things in Java applications that worked quite well in macOS Catalina. Oracle already announced macOS related improvements for Java 17 which is scheduled for Q3/2021.Other users have reported similar issues and some of them were able to prevent freezes using one of the two approaches below: