LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   get user info -- java (https://www.linuxquestions.org/questions/programming-9/get-user-info-java-308040/)

nadroj 03-30-2005 09:58 PM

get user info -- java
 
first post here.. just for future reference, this is;

the simple program im gonna write will have a need to know what the home path is for the currently logged in user. (or at least the user name, from which the first can be found of course)

ie, how do you find information about the currently logged in user? im sure from this method or class you can also discover things like their name, uptime maybe, home dir, etc...

mrcheeks 03-30-2005 11:22 PM

hi , use :
System.getProperty("user.name");
System.getProperty("user.home");

System.getProperties() contains all the available keys.

nadroj 03-30-2005 11:40 PM

alrighty... ya, that makes sense. i got the system class from java reference site bookmarked now. thanks


All times are GMT -5. The time now is 05:07 AM.