Does Java chronically freeze at the progress bar whenever you try to install it? In most circumstances I recommend disabling Java because of its innate security problems. But for some applications, Java is essential; therefore, we’ll need to make it work in those cases.
Here are two things you can do that will get you on your way:
1. Disable Antivirus
Some Antivirus programs might tag Java as a threat and stop the installation from completing so you should temporarily disable AV for the purposes of the install.
If you’re worried that briefly letting down the drawbridge and raising the gates to your castle is too risky then here’s a methodical way to mitigate the chance of being compromised:
- Disable your internet connection
- Disable antivirus protection
- Attempt to install Java
- Restore antivirus protection
- Enable your internet connection
Virus protection such as Microsoft Security Essentials, also known as Windows Defender, can sometimes gets in the way of Java installations. I wrote an article on how to turn on Windows Defender in Windows 8 but you can reverse the steps there to disable it.
2. Install jPortable
The nice thing about jPortable (formerly Java Portable) is that it lets you use a complete Java Runtime Environment (JRE) without actually installing the JRE on the computer.
This is how it works: first go to PortableApps.com to download the latest application.
Find the executable on your computer and click through the the language prompt.
Take the defaults and press on
Click Next on the license agreement screen.
As an aside, I have to say, sometimes I really wonder what I’m agreeing to.
Did I just give Oracle rights to my private data? Or maybe I’m giving Oracle permission to seize my organs? Who knows… but if you click Back you can’t use the software.
I usually just keep all the defaults so click Install.
jPortable downloads the latest Java package from Oracle and then installs the application in a matter of seconds.
And now you’re done!
The next thing I strongly recommend is to configure your Windows PATH variable so you can run your .JAR applications from the command prompt.
The PATH variable is just a list of directory paths that Windows checks whenever you enter a command without explicitly including the full folder location to where that command lives.
So for example, instead of typing:
C:\Program Files (x86)\Java\jre7\bin\java.exe
you can just type
And Windows will launch the program.
To get started we need to get into Advanced System Settings.
In Windows 8 press the Windows Key + w and type:
advanced system settings
In Windows 7, just click Start and type the same phrase.
Click the Environment Variables button.
Find the Path section in the lower half of the screen and click Edit.
Now in the little dialog box that pops open click in the Variable Value text area and paste in the full path to your Java executable.
Make sure you insert it after the semi-colon that closes any existing path variables.
You can find the path by pressing Windows Key + e and browsing through your Program Files directories.
Click OK, then open the command prompt and enter
java -jar thefileyouwant.jar
That should do the trick for you.