<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.lang.Runtime
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.lang.html">This Package</a>  <a href="java.lang.Process.html#_top_">Previous</a>  <a href="java.lang.SecurityManager.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.lang.Runtime
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.lang.Runtime
</pre>
<hr>
<dl>
  <dt> public class <b>Runtime</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#exec(java.lang.String)"><b>exec</b></a>(String)
  <dd>  Executes the specified string command in a separate process.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#exec(java.lang.String, java.lang.String[])"><b>exec</b></a>(String, String[])
  <dd>  Executes the specified string command in a separate process with the 
 specified environment.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#exec(java.lang.String[])"><b>exec</b></a>(String[])
  <dd>  Executes the specified command and arguments in a separate process.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#exec(java.lang.String[], java.lang.String[])"><b>exec</b></a>(String[], String[])
  <dd>  Executes the specified command and arguments in a separate process
 with the specified environment.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#exit(int)"><b>exit</b></a>(int)
  <dd>  Terminates the currently running Java Virtual Machine.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#freeMemory()"><b>freeMemory</b></a>()
  <dd>  Returns the amount of free memory in the system.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#gc()"><b>gc</b></a>()
  <dd>  Runs the garbage collector.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getLocalizedInputStream(java.io.InputStream)"><b>getLocalizedInputStream</b></a>(InputStream)
  <dd>  Creates a localized version of an input stream.
<b>Deprecated.</b>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getLocalizedOutputStream(java.io.OutputStream)"><b>getLocalizedOutputStream</b></a>(OutputStream)
  <dd>  Creates a localized version of an output stream.
<b>Deprecated.</b>
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getRuntime()"><b>getRuntime</b></a>()
  <dd>  Returns the runtime object associated with the current Java application.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#load(java.lang.String)"><b>load</b></a>(String)
  <dd>  Loads the specified filename as a dynamic library.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#loadLibrary(java.lang.String)"><b>loadLibrary</b></a>(String)
  <dd>  Loads the dynamic library with the specified library name.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#runFinalization()"><b>runFinalization</b></a>()
  <dd>  Runs the finalization methods of any objects pending finalization.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#runFinalizersOnExit(boolean)"><b>runFinalizersOnExit</b></a>(boolean)
  <dd>  Enable or disable finalization on exit; doing so specifies that the
 finalizers of all objects that have finalizers that have not yet been
 automatically invoked are to be run before the Java runtime exits.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#totalMemory()"><b>totalMemory</b></a>()
  <dd>  Returns the total amount of memory in the Java Virtual Machine.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#traceInstructions(boolean)"><b>traceInstructions</b></a>(boolean)
  <dd>  Enables/Disables tracing of instructions.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#traceMethodCalls(boolean)"><b>traceMethodCalls</b></a>(boolean)
  <dd>  Enables/Disables tracing of method calls.
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="getRuntime()"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getRuntime"><b>getRuntime</b></a>
<pre>
 public static <a href="#_top_">Runtime</a> getRuntime()
</pre>
<dl>
  <dd> Returns the runtime object associated with the current Java application.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the <code>Runtime</code> object associated with the current
          Java application.
  </dl></dd>
</dl>
<a name="exit(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="exit"><b>exit</b></a>
<pre>
 public void exit(int status)
</pre>
<dl>
  <dd> Terminates the currently running Java Virtual Machine. This 
 method never returns normally. 
 <p>
 If there is a security manager, its <code>checkExit</code> method 
 is called with the status as its argument. This may result in a 
 security exception. 
 <p>
 The argument serves as a status code; by convention, a nonzero 
 status code indicates abnormal termination.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> status - exit status.
    <dt> <b>Throws:</b> <a href="java.lang.SecurityException.html#_top_">SecurityException</a>
    <dd> if the current thread cannot exit with
               the specified status.
    <dt> <b>See Also:</b>
    <dd> <a href="java.lang.SecurityException.html#_top_">SecurityException</a>, <a href="java.lang.SecurityManager.html#checkExit(int)">checkExit</a>
  </dl></dd>
</dl>
<a name="runFinalizersOnExit(boolean)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="runFinalizersOnExit"><b>runFinalizersOnExit</b></a>
<pre>
 public static void runFinalizersOnExit(boolean value)
</pre>
<dl>
  <dd> Enable or disable finalization on exit; doing so specifies that the
 finalizers of all objects that have finalizers that have not yet been
 automatically invoked are to be run before the Java runtime exits.
 By default, finalization on exit is disabled.  An invocation of
 the runFinalizersOnExit method is permitted only if the caller is
 allowed to exit, and is otherwise rejected by the security manager.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#gc">gc</a>, <a href="#exit">exit</a>
  </dl></dd>
</dl>
<a name="exec(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="exec"><b>exec</b></a>
<pre>
 public <a href="java.lang.Process.html#_top_">Process</a> exec(<a href="java.lang.String.html#_top_">String</a> command) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Executes the specified string command in a separate process. 
 <p>
 The <code>command</code> argument is parsed into tokens and then 
 executed as a command in a separate process. This method has 
 exactly the same effect as <code>exec(command, null)</code>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> command - a specified system command.
    <dt> <b>Returns:</b>
    <dd> a <code>Process</code> object for managing the subprocess.
    <dt> <b>Throws:</b> <a href="java.lang.SecurityException.html#_top_">SecurityException</a>
    <dd> if the current thread cannot create a
             subprocess.
    <dt> <b>See Also:</b>
    <dd> <a href="#exec(java.lang.String, java.lang.String[])">exec</a>
  </dl></dd>
</dl>
<a name="exec(java.lang.String, java.lang.String[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="exec"><b>exec</b></a>
<pre>
 public <a href="java.lang.Process.html#_top_">Process</a> exec(<a href="java.lang.String.html#_top_">String</a> command,
                     <a href="java.lang.String.html#_top_">String</a> envp[]) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Executes the specified string command in a separate process with the 
 specified environment. 
 <p>
 This method breaks the <code>command</code> string into tokens and 
 creates a new array <code>cmdarray</code> containing the tokens; it 
 then performs the call <code>exec(cmdarray, envp)</code>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> command - a specified system command.
    <dd> envp - array containing environment in format
                       <i>name</i>=<i>value</i>
    <dt> <b>Returns:</b>
    <dd> a <code>Process</code> object for managing the subprocess.
    <dt> <b>Throws:</b> <a href="java.lang.SecurityException.html#_top_">SecurityException</a>
    <dd> if the current thread cannot create a
               subprocess.
    <dt> <b>See Also:</b>
    <dd> <a href="#exec(java.lang.String[], java.lang.String[])">exec</a>
  </dl></dd>
</dl>
<a name="exec(java.lang.String[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="exec"><b>exec</b></a>
<pre>
 public <a href="java.lang.Process.html#_top_">Process</a> exec(<a href="java.lang.String.html#_top_">String</a> cmdarray[]) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Executes the specified command and arguments in a separate process.
 <p>
 The command specified by the tokens in <code>cmdarray</code> is 
 executed as a command in a separate process. This has exactly the 
 same effect as <code>exec(cmdarray, null)</code>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> cmdarray - array containing the command to call and
                        its arguments.
    <dt> <b>Returns:</b>
    <dd> a <code>Process</code> object for managing the subprocess.
    <dt> <b>Throws:</b> <a href="java.lang.SecurityException.html#_top_">SecurityException</a>
    <dd> if the current thread cannot create a
               subprocess.
    <dt> <b>See Also:</b>
    <dd> <a href="#exec(java.lang.String[], java.lang.String[])">exec</a>
  </dl></dd>
</dl>
<a name="exec(java.lang.String[], java.lang.String[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="exec"><b>exec</b></a>
<pre>
 public <a href="java.lang.Process.html#_top_">Process</a> exec(<a href="java.lang.String.html#_top_">String</a> cmdarray[],
                     <a href="java.lang.String.html#_top_">String</a> envp[]) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Executes the specified command and arguments in a separate process
 with the specified environment. 
 <p>
 If there is a security manager, its <code>checkExec</code> method 
 is called with the first component of the array 
 <code>cmdarray</code> as its argument. This may result in a security 
 exception. 
 <p>
 Given an array of strings <code>cmdarray</code>, representing the 
 tokens of a command line, and an array of strings <code>envp</code>, 
 representing an "environment" that defines system 
 properties, this method creates a new process in which to execute 
 the specified command.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> cmdarray - array containing the command to call and
                        its arguments.
    <dd> envp - array containing environment in format
                        <i>name</i>=<i>value</i>.
    <dt> <b>Returns:</b>
    <dd> a <code>Process</code> object for managing the subprocess.
    <dt> <b>Throws:</b> <a href="java.lang.SecurityException.html#_top_">SecurityException</a>
    <dd> if the current thread cannot create a
               subprocess.
    <dt> <b>See Also:</b>
    <dd> <a href="java.lang.SecurityException.html#_top_">SecurityException</a>, <a href="java.lang.SecurityManager.html#checkExec(java.lang.String)">checkExec</a>
  </dl></dd>
</dl>
<a name="freeMemory()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="freeMemory"><b>freeMemory</b></a>
<pre>
 public native long freeMemory()
</pre>
<dl>
  <dd> Returns the amount of free memory in the system. The value returned
 by this method is always less than the value returned by the
 <code>totalMemory</code> method. Calling the <code>gc</code> method may
 result in increasing the value returned by <code>freeMemory.</code>
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> an approximation to the total amount of memory currently
          available for future allocated objects, measured in bytes.
  </dl></dd>
</dl>
<a name="totalMemory()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="totalMemory"><b>totalMemory</b></a>
<pre>
 public native long totalMemory()
</pre>
<dl>
  <dd> Returns the total amount of memory in the Java Virtual Machine.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the total amount of memory currently available for allocating
          objects, measured in bytes.
  </dl></dd>
</dl>
<a name="gc()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="gc"><b>gc</b></a>
<pre>
 public native void gc()
</pre>
<dl>
  <dd> Runs the garbage collector.
 Calling this method suggests that the Java Virtual Machine expend 
 effort toward recycling unused objects in order to make the memory 
 they currently occupy available for quick reuse. When control 
 returns from the method call, the Java Virtual Machine has made 
 its best effort to recycle all unused objects. 
 <p>
 The name <code>gc</code> stands for "garbage 
 collector". The Java Virtual Machine performs this recycling 
 process automatically as needed even if the <code>gc</code> method 
 is not invoked explicitly.
<p>
</dl>
<a name="runFinalization()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="runFinalization"><b>runFinalization</b></a>
<pre>
 public native void runFinalization()
</pre>
<dl>
  <dd> Runs the finalization methods of any objects pending finalization.
 Calling this method suggests that the Java Virtual Machine expend 
 effort toward running the <code>finalize</code> methods of objects 
 that have been found to be discarded but whose <code>finalize</code> 
 methods have not yet been run. When control returns from the 
 method call, the Java Virtual Machine has made a best effort to 
 complete all outstanding finalizations. 
 <p>
 The Java Virtual Machine performs the finalization process 
 automatically as needed if the <code>runFinalization</code> method 
 is not invoked explicitly.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.lang.Object.html#finalize()">finalize</a>
  </dl></dd>
</dl>
<a name="traceInstructions(boolean)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="traceInstructions"><b>traceInstructions</b></a>
<pre>
 public native void traceInstructions(boolean on)
</pre>
<dl>
  <dd> Enables/Disables tracing of instructions.
 If the <code>boolean</code> argument is <code>true</code>, this 
 method asks the Java Virtual Machine to print out a detailed trace 
 of each instruction in the Java Virtual Machine as it is executed. 
 The virtual machine may ignore this request if it does not support 
 this feature. The destination of the trace output is system 
 dependent. 
 <p>
 If the <code>boolean</code> argument is <code>false</code>, this 
 method causes the Java Virtual Machine to stop performing the 
 detailed instruction trace it is performing.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> on - <code>true</code> to enable instruction tracing;
               <code>false</code> to disable this feature.
  </dl></dd>
</dl>
<a name="traceMethodCalls(boolean)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="traceMethodCalls"><b>traceMethodCalls</b></a>
<pre>
 public native void traceMethodCalls(boolean on)
</pre>
<dl>
  <dd> Enables/Disables tracing of method calls.
 If the <code>boolean</code> argument is <code>true</code>, this 
 method asks the Java Virtual Machine to print out a detailed trace 
 of each method in the Java Virtual Machine as it is called. The 
 virtual machine may ignore this request if it does not support 
 this feature. The destination of the trace output is system dependent. 
 <p>
 If the <code>boolean</code> argument is <code>false</code>, this 
 method causes the Java Virtual Machine to stop performing the 
 detailed method trace it is performing.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> on - <code>true</code> to enable instruction tracing;
               <code>false</code> to disable this feature.
  </dl></dd>
</dl>
<a name="load(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="load"><b>load</b></a>
<pre>
 public synchronized void load(<a href="java.lang.String.html#_top_">String</a> filename)
</pre>
<dl>
  <dd> Loads the specified filename as a dynamic library. The filename 
 argument must be a complete pathname. 
 From <code>java_g</code> it will automagically insert "_g" before the
 ".so" (for example
 <code>Runtime.getRuntime().load("/home/avh/lib/libX11.so");</code>).
 <p>
 If there is a security manager, its <code>checkLink</code> method 
 is called with the <code>filename</code> as its argument. This may 
 result in a security exception.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> filename - the file to load.
    <dt> <b>Throws:</b> <a href="java.lang.SecurityException.html#_top_">SecurityException</a>
    <dd> if the current thread cannot load the
               specified dynamic library.
    <dt> <b>Throws:</b> <a href="java.lang.UnsatisfiedLinkError.html#_top_">UnsatisfiedLinkError</a>
    <dd> if the file does not exist.
    <dt> <b>See Also:</b>
    <dd> <a href="#getRuntime()">getRuntime</a>, <a href="java.lang.SecurityException.html#_top_">SecurityException</a>, <a href="java.lang.SecurityManager.html#checkLink(java.lang.String)">checkLink</a>
  </dl></dd>
</dl>
<a name="loadLibrary(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="loadLibrary"><b>loadLibrary</b></a>
<pre>
 public synchronized void loadLibrary(<a href="java.lang.String.html#_top_">String</a> libname)
</pre>
<dl>
  <dd> Loads the dynamic library with the specified library name. The 
 mapping from a library name to a specific filename is done in a 
 system-specific manner. 
 <p>
 First, if there is a security manager, its <code>checkLink</code> 
 method is called with the <code>filename</code> as its argument. 
 This may result in a security exception. 
 <p>
 If this method is called more than once with the same library 
 name, the second and subsequent calls are ignored.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> libname - the name of the library.
    <dt> <b>Throws:</b> <a href="java.lang.SecurityException.html#_top_">SecurityException</a>
    <dd> if the current thread cannot load the
               specified dynamic library.
    <dt> <b>Throws:</b> <a href="java.lang.UnsatisfiedLinkError.html#_top_">UnsatisfiedLinkError</a>
    <dd> if the library does not exist.
    <dt> <b>See Also:</b>
    <dd> <a href="java.lang.SecurityException.html#_top_">SecurityException</a>, <a href="java.lang.SecurityManager.html#checkLink(java.lang.String)">checkLink</a>
  </dl></dd>
</dl>
<a name="getLocalizedInputStream(java.io.InputStream)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getLocalizedInputStream"><b>getLocalizedInputStream</b></a>
<pre>
 public <a href="java.io.InputStream.html#_top_">InputStream</a> getLocalizedInputStream(<a href="java.io.InputStream.html#_top_">InputStream</a> in)
</pre>
<dl>
<dd><b> Note: getLocalizedInputStream() is deprecated.</b>
<i>As of JDK&nbsp;1.1, the preferred way translate a byte
 stream in the local encoding into a character stream in Unicode is via
 the <code>InputStreamReader</code> and <code>BufferedReader</code>
 classes.</i>
<p>
  <dd> Creates a localized version of an input stream. This method takes 
 an <code>InputStream</code> and returns an <code>InputStream</code> 
 equivalent to the argument in all respects except that it is 
 localized: as characters in the local character set are read from 
 the stream, they are automatically converted from the local 
 character set to Unicode. 
 <p>
 If the argument is already a localized stream, it may be returned 
 as the result.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> a localized input stream.
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.InputStream.html#_top_">InputStream</a>, <a href="java.io.BufferedReader.html#BufferedReader(java.io.Reader)">BufferedReader</a>, <a href="java.io.InputStreamReader.html#InputStreamReader(java.io.InputStream)">InputStreamReader</a>
  </dl></dd>
</dl>
<a name="getLocalizedOutputStream(java.io.OutputStream)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getLocalizedOutputStream"><b>getLocalizedOutputStream</b></a>
<pre>
 public <a href="java.io.OutputStream.html#_top_">OutputStream</a> getLocalizedOutputStream(<a href="java.io.OutputStream.html#_top_">OutputStream</a> out)
</pre>
<dl>
<dd><b> Note: getLocalizedOutputStream() is deprecated.</b>
<i>As of JDK&nbsp;1.1, the preferred way to translate a
 Unicode character stream into a byte stream in the local encoding is via
 the <code>OutputStreamWriter</code>, <code>BufferedWriter</code>, and
 <code>PrintWriter</code> classes.</i>
<p>
  <dd> Creates a localized version of an output stream. This method 
 takes an <code>OutputStream</code> and returns an 
 <code>OutputStream</code> equivalent to the argument in all respects 
 except that it is localized: as Unicode characters are written to 
 the stream, they are automatically converted to the local 
 character set. 
 <p>
 If the argument is already a localized stream, it may be returned 
 as the result.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> a localized output stream.
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.OutputStream.html#_top_">OutputStream</a>, <a href="java.io.BufferedWriter.html#BufferedWriter(java.io.Writer)">BufferedWriter</a>, <a href="java.io.OutputStreamWriter.html#OutputStreamWriter(java.io.OutputStream)">OutputStreamWriter</a>, <a href="java.io.PrintWriter.html#PrintWriter(java.io.OutputStream)">PrintWriter</a>
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.lang.html">This Package</a>  <a href="java.lang.Process.html#_top_">Previous</a>  <a href="java.lang.SecurityManager.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
