This post is about summarizing different ways to check if user is admin in JAva
Use system calls to check if user is admin
A Java application can call system command through the class Runnable
You can see this post about ways to know if from command line.
The code to execute a command from a Java application:
You will need to make some adjustments depending on operating system.
Use isElevationNeeded from PriviledgeRunner class
Method isElevationNeeded from PriviledgeRunner class in IzPack uses this method.
You might also be interested in…
- “Detect if user is admin“; stackoverflow.com