Start the Java program as administrator - how it works
This practical guide shows you how to start a Java program as an administrator.
Start the Java program via a batch file with administrator rights
If the Java program is available as a compiled EXE file, it can be run like any other application as an administrator (right-click> Run as ...). If you only have a JAR file instead, you can help yourself with a small batch file:
- Open any text editor.
- Write "start% ~ dp0XXX.jar" on the first line (without quotes). Instead of "XXX", enter the name of the associated JAR file.
- Save the file under any name with the extension .bat in the same directory in which the JAR file is located.
- Right click on the created BAT file. Now select "Run as administrator" in the context menu.
Read the following practical tip on how to always run programs as an administrator in Windows 8. This guide will help you with Windows 7.