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) {
    System.out.println(System.getProperty("user.dir"));
}

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

public static void main(String[] args) {
    String javaHome = System.getProperty("java.home");
    System.out.println("javaHome = " + javaHome);
}

From source file:Main.java

public static void main(String[] args) {
    System.out.println(System.getProperty("java.class.path"));
}

From source file:Main.java

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

From source file:Main.java

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

    System.out.println("JRE Version = " + version);
}

From source file:Main.java

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

From source file:MainClass.java

public static void main(String[] a) {
    System.out.println(System.getProperty("file.encoding"));
}

From source file:MainClass.java

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