• Post Reply Bookmark Topic Watch Topic
  • New Topic

Linux System Variables  RSS feed

 
Bryce V.
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, i admit i have an odd question to post here. Maybe someone has an answer for me.
I am having a hard time getting the full path to a users home directory with Java on Linux. I also can't seen to access some commands from java( in this case "cd").
Output of another program i get the output, "~/prog", i need to find a way to expand the system variable "~". Which i can do under a terminal in linux, but not from within java. Any and all ideas would be greatly appreicated.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System.getProperty("user.home") should give you the value that "~" expands to.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!