Before we get started with the steps, first try and reinstall Minecraft to ensure there are no corrupt files causing issues. Make sure you save your worlds properly so you don't lose any progress.
There are various instances of this issue that we get such as JAVAC’, JRE, ‘MVN’, JAR’ is not recognized as an internal or external command, operable program or batch file, ‘Java’ is not recognized as ...