How do I get user's login name in Java without using any JNI stuff?
I found one example here:
but the code won't compile because it choked up on this line:
and I have no idea how to fix it. Can someone offer me some help?
Principal principals = (Principal)subject.getPrincipals().toArray(new Principal);
below is what I imported for the little program: