Previous | Next | Trail Map | Writing Java Programs | Using System Resources


The Runtime Object

At the core of the Java runtime environment is the Java virtual machine, the Java interpreter and the host operating system.

The oval labelled Runtime in the diagram is an instance of the Runtime class (a member of the java.lang package) and represents the "current runtime environment" which could be anything from Sun's implementation of the Java Virtual Machine and interpreter running on Solaris to ACME Company's implementation of the Virtual Machine and interpreter running on the ACME toaster.

Runtime objects provide two services. First, they communicate with the components of the runtime environment--getting information and invoking functions. Second, Runtime objects are also the interface to system-dependent capabilities. For example, UNIX runtime objects might support the getenv() and setenv() functions. Other runtime objects, such as MacOS, may not support getenv() and setenv() (because the host operating system doesn't support these functions) but may support others.

Because the Runtime class is tightly integrated with the implementation of the Java interpreter, the Java Virtual Machine and the host operating system, it is system dependent. If objects in your program message the Runtime object directly, your program is likely to be system dependent and require modifications before being able to run on other systems.

Even though different systems provide different ways for doing things, there is some overlap and commonality in the services that they provide.

See also

java.lang.Runtime


Previous | Next | Trail Map | Writing Java Programs | Using System Resources