Java: run as administrator
The easiest way would be to use a wrapper to launch your JVM, then elevate the wrapper. I use a simple NSIS installer script with the UAC plugin to do this:
; Java Launcher;--------------; You want to change the below lines Name "my program" Caption "my program Launcher" Icon "iconfile.ico" OutFile "java launcher.exe"; param below can be user, admin RequestExecutionLevel admin!include UAC.nshSilentInstall silentAutoCloseWindow trueShowInstDetails showSection "" ; command to execute StrCpy $0 'javaw -jar myjarfile' SetOutPath $EXEDIR Exec $0 SectionEnd
ZippyV's answer is fine if you intend to launch the javaw.exe with system admin privileges, which if pure java code is what is getting blocked by the UAC (such as trying to write a file to a privileged directory), then that is what you will need to do.
If, however, you are trying to launch something external, but just with elevation, you could bundle an exe which elevates a command. Here is one.