I'm running a virtual machine with Win7 and Java version 8, update 181 (build 1.8.0_181-b13) and Arduino IDE 1.8.19. It occasionally hangs and becomes unresponsive until I force a shutdown or reboot and get a windows memory exception error.
Is there a preferred version of Java for this OS and IDE?
IDE 1.x comes with its own JRE and as far as I know (but not sure) that is used. If you have Oracle Java or some other Java installed, you can uninstall it and the IDE should still work.
I have had plenty of systems without Java installed where the IDE happily worked (obviously using the included JRE).