How to check if User is admin from a Java Application

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:

Runtime.getRuntime().exec(command);

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…

External references

Leave a Reply

Your email address will not be published. Required fields are marked *