Rahul's Tech Blog

Growth Hacking, Just Hacking or No hacking !!!

How to run a jar file as administrator in windows

Sometimes application needs administrator privilege during installation.
If its an *.exe file, you can easily right click on it and choose “run as Administrator” option.

But what if the installer is a *.jar file.
To run a jar file as administrator, Run command prompt as administrator first.
Start > cmd > right click > run as administrator.

Now run the jar file using
java -jar c:\path\to\jar\file.jar

  • Zach

    ‘java’ is not recognized as an internal or external command, operable program or batch file.

    what did i do wrong?

  • http://nicholls.azurewebsites.net/ Juan David Nicholls

    install java xD

  • Meior

    So what if it is installed and it still returns this….

  • http://blog.rahulprasad.com/ Rahul Prasad

    Use “path to java.exe” instead of just “java”

  • http://nicholls.azurewebsites.net/ Juan David Nicholls
  • Lora Powell

    Thank you! This was helpful…

  • RVP

    Add path to java.exe to your environment variable called %PATH%

  • Awijit Singh

    Saved my time thanks.

  • ZERA

    Very Awesome. I waste time about 1 hour…