Skip to content

Instantly share code, notes, and snippets.

@Kurt-P
Last active August 29, 2015 13:58
Show Gist options
  • Save Kurt-P/9927169 to your computer and use it in GitHub Desktop.
Save Kurt-P/9927169 to your computer and use it in GitHub Desktop.
public class JavaHome {
public static void main(String[] args) {
String home = System.getProperty("user.home");
System.out.printf("%s\n", home);
}
}
import java.io.File;
public class TeatSSH {
public static void main(String[] args) {
File dir = new File(System.getProperty("user.home") + File.separator + ".ssh");
//System.out.println(dir.toString());
if (dir.exists()) {
System.out.println(dir.getAbsolutePath());
}
else {
System.out.println("No such file");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment