Many users of Windows 10 are having issues with running .jar files to install mods such as Optifine. This is intended to show you how to easily run a jar file.
Note: If the images don't appear, click on the IMG tag, and it should open the image on imgur
Note: If the images don't appear, click on the IMG tag, and it should open the image on imgur
The first step in running a jar file is making sure you have a .jar file. For this tutorial I will be using Optifine for 1.9.4; You can click here to download the version I will be using
Step number two involves the program for making the program that will be executing the file. We will actually be using the built in functions of windows to run our completed program.
First, we need a text editor. I like to use Notepad++ for this, as it is a free program and is open source. Download and open up Notepad++; you should have an empty document. This is where we will be writing the code for the program.
First, we need a text editor. I like to use Notepad++ for this, as it is a free program and is open source. Download and open up Notepad++; you should have an empty document. This is where we will be writing the code for the program.
We now need to write the code that will run the .jar file. You can copy and paste the code below into the blank document, but replace {Name} with the name of your .jar file.
After you do that, your screen should look like this: (be sure to include the .jar extension after your file name)
Code:
java -jar {Name}
To run the program we need to save it as a Batch file, or a .bat;
In Notepad++, go to "Save As" in the File menu. Then, in the dropdown selector of filetypes you will want to select "Batch file". The name of your file is not important, but you need to remember where you save it. The desktop or the downloads folder are both usually good choices. Once you've renamed it to whatever you like, save it. (Note: it will need to be in the same folder as the .jar file)
You can see here, I named mine "JavaInstall" and it has the .bat file extension:
In Notepad++, go to "Save As" in the File menu. Then, in the dropdown selector of filetypes you will want to select "Batch file". The name of your file is not important, but you need to remember where you save it. The desktop or the downloads folder are both usually good choices. Once you've renamed it to whatever you like, save it. (Note: it will need to be in the same folder as the .jar file)
You can see here, I named mine "JavaInstall" and it has the .bat file extension:
The last step is to run the file. Close Notepad++ and navigate to where your new .bat file is located. Then, run the .bat file. Command prompt should open in the background, and your .jar should start to run like normal. If it doesn't run, make sure that the .jar file is in the same folder as the .bat file
Last edited: