Last active
August 29, 2015 13:58
-
-
Save Kurt-P/9927169 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JavaHome { | |
public static void main(String[] args) { | |
String home = System.getProperty("user.home"); | |
System.out.printf("%s\n", home); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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