Need help with my messed up java

When ever I click on a file that uses java like a ,jar it just opens cmd for an instant and then goes away. It doesn't open any program. Java on minecraft works fine but when I open a file that uses java it doesn't work. A friend showed me how to get the any of the files working as a temp but I forgot how to do it. Tried to install mods yesterday to get the shader mod installed but my java is messed up. Do I run a .bat file or do I completely reinstall java?

Let me know if you need any more information.

just reinstall java. not that hard. I WRITE java... that's completely different