Some users may get a "You don't have permission to save in this location" error while saving Java files in Windows. Even though you are the administrator of your PC, this error shows up out of nowhere. To fix the problem, right-click the Java folder's "Properties" and navigate to the "Security -> Advanced -> Select User or Group."
In the "Advanced Security" settings for Java, change the "Owner" from "System" to whatever user account you have used to log in to the device. You can determine the correct name from "Check names." Just enter the text, such as "Desktop," "Administrator," or "Users," to enable full permissions to the folder. Click "OK" and save the changes.