Have you checked that your environment variables are set up correctly? If you have multiple versions of Java installed (JRE and JDK, for instance), it may be a PATH issue. This page has instructions for Windows 10, but I think the same instructions will work with Windows 11, too:
https://www.java.com/en/download/help/path.html.
Best,
Abby
Abigail Cramer Wolf
Digital Preservation Analyst
Harvard Library Preservation Services