Published Jun 24th, 2023, 6/24/23 12:43 pm
- 2,466 views, 16 today
- 10
- 6
- 5
29
Most people's Optifine installs like a breeze
But some PCs are built different
We are going to be using Optifine because it installs as its own launcher and is so widespread (this is a Windows PC only and java edition tutorial)
First things first: make sure Java is installed (you can check by hitting Windows and typing "Java" and if "configure java" comes up you're good. Make sure to have the latest version installed by clicking configure java > updates.
If you don't have java, go to the official site here to download it.

Download the installer and follow the steps
Once you do that, download the stubborn .jar you want to install (in this case Optifine) and we'll move to the next step
Most people can just double-click and install Optifine right away, but some PCs don't do that for some reason, but thankfully there's an easy no-extra-installations fix.

What it looks like when I double-click Optifine.
You can fix this by going to your desktop, and creating a text file.

Call it whatever you like, I named it "installer"
Now open it, and copy paste this code here:
java -jar [nameoffile].jar
Make sure you have "File name extensions" checked in file explorer > view > file name extensions

Now drag your .jar file to the desktop as well, and click "rename" to get its full name. Input this into the text file where [nameoffile] is listed. (make sure there is only one .jar at the end)

Now save the text file and change the .txt at the end to a .bat (so it is now a batch file)

And run the batch file (double click it)! This will run your .jar file (in this case Optifine) and you can then proceed as normal following the steps Optifine (or any other .jar) has listed.

It is normal for a command prompt window to open too (cmd) this will go away as soon as you exit the application.
Congratulations! You have now fixed your weird .jar problem!
You can do this with any amount of .jar files, by changing the name of the file for whatever mod or other file you wish in the .bat by right-clicking and hitting "edit". Make sure to save every time!
But some PCs are built different
We are going to be using Optifine because it installs as its own launcher and is so widespread (this is a Windows PC only and java edition tutorial)
First things first: make sure Java is installed (you can check by hitting Windows and typing "Java" and if "configure java" comes up you're good. Make sure to have the latest version installed by clicking configure java > updates.
If you don't have java, go to the official site here to download it.

Download the installer and follow the steps
Once you do that, download the stubborn .jar you want to install (in this case Optifine) and we'll move to the next step
Most people can just double-click and install Optifine right away, but some PCs don't do that for some reason, but thankfully there's an easy no-extra-installations fix.

What it looks like when I double-click Optifine.
You can fix this by going to your desktop, and creating a text file.

Call it whatever you like, I named it "installer"
Now open it, and copy paste this code here:
java -jar [nameoffile].jar
Make sure you have "File name extensions" checked in file explorer > view > file name extensions

Now drag your .jar file to the desktop as well, and click "rename" to get its full name. Input this into the text file where [nameoffile] is listed. (make sure there is only one .jar at the end)

Now save the text file and change the .txt at the end to a .bat (so it is now a batch file)

And run the batch file (double click it)! This will run your .jar file (in this case Optifine) and you can then proceed as normal following the steps Optifine (or any other .jar) has listed.

It is normal for a command prompt window to open too (cmd) this will go away as soon as you exit the application.
Congratulations! You have now fixed your weird .jar problem!
You can do this with any amount of .jar files, by changing the name of the file for whatever mod or other file you wish in the .bat by right-clicking and hitting "edit". Make sure to save every time!
Credit | I didn't create this method, however I don't know who did. |
Tags |
5982502
6
Create an account or sign in to comment.
The JRE installer should set file associations for you alongside the environment variables (which must be working for the java command to run anywhere), so just reinstalling Java should have been fine enough.
in all fairness, java has always been a little weird for me so I guess stuff just not working for some people is normal? I couldn't even run Worlds without uninstalling Java 17 and putting the devkit in it's own folder because it wouldn't stop skipping over java 8. running javaw.exe directly is a useful workaround, shame the optifine devs don't pack the jar binary in an EXE to make things simpler.
great tutorial btw