System.getProperty : Runtime System « Development « Java Tutorial






class ShowUserDir {
  public static void main(String args[]) {
    System.out.println(System.getProperty("user.dir"));
  }
}
The following properties are available:

file.separator

java.specification.version

java.vm.version

java.class.path

java.vendor

line.separator

java.class.version

java.vendor.url

os.arch

java.compiler

java.version

os.name

java.ext.dirs

java.vm.name

os.version

java.home

java.vm.specification.name

path.separator

java.io.tmpdir

java.vm.specification.vendor

user.dir

java.library.path

java.vm.specification.version

user.home

java.specification.name

java.vm.vendor

user.name

java.specification.vendor








6.47.Runtime System
6.47.1.Milliseconds elapsed since January 1, 1970
6.47.2.Demonstrate totalMemory(), freeMemory() and gc().
6.47.3.Demonstrate exec().
6.47.4.Wait until notepad is terminated.
6.47.5.Timing program execution.
6.47.6.Using arraycopy().
6.47.7.Display the total amount of memory in the Java virtual machine.
6.47.8.Display the maximum amount of memory
6.47.9.Display the amount of free memory in the Java Virtual Machine.
6.47.10.Get Number of Available Processors
6.47.11.System.getProperty
6.47.12.Execute system command
6.47.13.Determine when the application is about to exit
6.47.14.Execute a command from code
6.47.15.Execute a command with more than one argument
6.47.16.Launch a Unix script with Java
6.47.17.Read output from a Command execution
6.47.18.Send an Input to a Command
6.47.19.From Runtime.exec() to ProcessBuilder
6.47.20.Registering Shutdown Hooks for Virtual Machine