All statements in a Java source file must be inside a method body.
On Mac, the tar command will put a bunch of junk in your archives unless
you turn Mac junk off.
On Mac, it’s important that you get the correct version of the JDK for your
hardware. Are you x64 or aarch64?
College is an excellent time to learn to work with desktop Linux.
Installing Linux Mint on a refurbished laptop is recommended. Look
for the Thinkpad x260, t460, x270, t470, x280, t480, x390, x395,
x13, t14 on Amazon or eBay. I got a working x260 off eBay recently
for $85, including shipping.