First, I am studying Java, but I am still very new to it, so complicated code will go over my head.
When I download a .jar file to say install a mod to minecraft and
According to Johann Loefflmann, the root cause for the problem above is, that a program has stolen the .jar association. And he is right! Just follow the link below and install a small file JARFIX and the association will be set back and you can double click any jar file and run it in windows. It works for me (I have the same problem and before these I tried all solutions mentioned in the forum and failed).
https://johann.loefflmann.net/en/software/jarfix/index.html