LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-30-2005, 09:58 PM   #1
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
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...

Last edited by nadroj; 03-30-2005 at 10:04 PM.
 
Old 03-30-2005, 11:22 PM   #2
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

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

System.getProperties() contains all the available keys.
 
Old 03-30-2005, 11:40 PM   #3
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Original Poster
Rep: Reputation: 60
alrighty... ya, that makes sense. i got the system class from java reference site bookmarked now. thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
file permissions and other info ok when root, but not ok with other user benobi Linux - Newbie 3 10-17-2005 12:28 PM
User-Space Routing Info cophy Linux - Networking 1 07-23-2005 10:35 AM
Review not showing up on user info Artanicus LQ Suggestions & Feedback 4 02-25-2005 11:34 AM
Changing User Info... rnturn LQ Suggestions & Feedback 4 12-26-2004 08:51 AM
GAIM user info hyperlinks fatman Linux - Software 2 04-13-2003 07:35 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration