How to locate the java file to open.jar files?

My brother changed how to open.jar files on my computer, i've now downloaded the newest java but my computer doesn't know that it needs to use that to open the optifine.jar file with java because i don't know how to tell it to. What do i go to when it says "open with" i can't find java. I just want to run optifine's installer.

Added (1). all i want is to put optifine in my ******* minecraft what file in java do i click to run optifine thats all i need

Added (2). i have no ******* idea what any of you are saying please put it in terms people who don't work on computers would know

Do you have 32-bit or 64-bit Windows? If you have 64-bit Windows and want to install 64-bit Java, you usually need to do that manually because the default web browser is usually 32-bit which would install 32-bit Java.
http://www.java.com/...manual.jsp

See if the following in a command window (cmd.exe) shows a java version: java -v

If it does you should be able to run the optifine installer by cd to the directory containing the optifine.jar (or whatever specific filename) then: java -jar optifine.jar

The executable is javaw.exe in Java's bin folder. It's not enough to set it though.

You should
1: *****-slap your brother really hard
2: remove, then reinstall the JRE

Alternatively, *****-slap your brother really hard, then get a program called "Default Programs Editor": http://defaultprogramseditor.com/
Run it, then click "File Type Settings", then "Context Menu", then select.jar, then select "Open" and click on "Edit selected command…", then enter this as Program Path:

"C:\Program Files\Java\jre1.8.0\bin\javaw.exe" -jar "%1" %*

Obviously, the path to javaw.exe has to match your installation.