Example usage for java.lang System getProperty

List of usage examples for java.lang System getProperty

Introduction

In this page you can find the example usage for java.lang System getProperty.

Prototype

public static String getProperty(String key) 

Source Link

Document

Gets the system property indicated by the specified key.

Usage

From source file:Main.java

public static void main(String[] args) {
    String dataFolder = System.getProperty("user.dir") + System.getProperty("file.separator") + "data";

    System.out.println("Data Folder = " + dataFolder);
}

From source file:Main.java

public static void main(String[] args) {
    String currentUser = System.getProperty("user.name");
    System.out.println(currentUser);
}

From source file:GetVersion.java

public static void main(String[] args) {
    System.out.println(System.getProperty("java.specification.version"));
    System.out.println("System.getenv(\"PATH\") = " + System.getenv("PATH"));
}

From source file:Main.java

public static void main(String[] argv) throws Exception {

    String curDir = System.getProperty("user.dir");
}

From source file:Main.java

public static void main(String[] args) {
    String userHome = "user.home";

    String path = System.getProperty(userHome);

    System.out.println("Your Home Path: " + path);
}

From source file:Main.java

    public static void main(String[] argv) throws Exception {
  
  String prop = System.getProperty("my.prop");
  
}

From source file:Main.java

public static void main(String[] args) {
    System.out.println(System.getProperty("java.runtime.version"));

    Properties p = System.getProperties();
    p.put("java.runtime.version", "Java Runtime 1.6.0");
    System.setProperties(p);/*from w  w  w  .  j  a  v  a2s  .c o m*/

    System.out.println(System.getProperty("java.runtime.version"));
}

From source file:Main.java

public static void main(String[] args) {
    String property = "java.io.tmpdir";

    String tempDir = System.getProperty(property);
    System.out.println("OS current temporary directory is " + tempDir);
}

From source file:MainClass.java

public static void main(String args[]) {
    System.out.println(System.getProperty("user.dir"));
}

From source file:MainClass.java

public static void main(String[] args) {
    System.setProperty("password", "myPassword");
    System.out.println(System.getProperty("password"));

}