forked from bjmashibing/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRuntime.html
More file actions
1268 lines (1232 loc) · 63.8 KB
/
Copy pathRuntime.html
File metadata and controls
1268 lines (1232 loc) · 63.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>Runtime (Java SE 12 & JDK 12 )</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="java.lang.Runtime class">
<meta name="keywords" content="getRuntime()">
<meta name="keywords" content="exit()">
<meta name="keywords" content="addShutdownHook()">
<meta name="keywords" content="removeShutdownHook()">
<meta name="keywords" content="halt()">
<meta name="keywords" content="exec()">
<meta name="keywords" content="availableProcessors()">
<meta name="keywords" content="freeMemory()">
<meta name="keywords" content="totalMemory()">
<meta name="keywords" content="maxMemory()">
<meta name="keywords" content="gc()">
<meta name="keywords" content="runFinalization()">
<meta name="keywords" content="traceInstructions()">
<meta name="keywords" content="traceMethodCalls()">
<meta name="keywords" content="load()">
<meta name="keywords" content="loadLibrary()">
<meta name="keywords" content="version()">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
<script type="text/javascript" src="../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Runtime (Java SE 12 & JDK 12 )";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":9,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":42,"i20":42,"i21":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../index.html">Overview</a></li>
<li><a href="../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Runtime.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 & JDK 12</strong> </div></div>
</div>
<div class="subNav">
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested.class.summary">Nested</a> | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding"> </div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="moduleLabelInType">Module</span> <a href="../../module-summary.html">java.base</a></div>
<div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">java.lang</a></div>
<h2 title="Class Runtime" class="title">Class Runtime</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="Object.html" title="class in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>java.lang.Runtime</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<pre>public class <span class="typeNameLabel">Runtime</span>
extends <a href="Object.html" title="class in java.lang">Object</a></pre>
<div class="block">Every Java application has a single instance of class
<code>Runtime</code> that allows the application to interface with
the environment in which the application is running. The current
runtime can be obtained from the <code>getRuntime</code> method.
<p>
An application cannot create its own instance of this class.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.0</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#getRuntime()"><code>getRuntime()</code></a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<div class="memberSummary">
<table>
<caption><span>Nested Classes</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>static class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="Runtime.Version.html" title="class in java.lang">Runtime.Version</a></span></code></th>
<td class="colLast">
<div class="block">A representation of a version string for an implementation of the
Java SE Platform.</div>
</td>
</tr>
</tbody>
</table>
</div>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<div class="memberSummary">
<div role="tablist" aria-orientation="horizontal"><button role="tab" aria-selected="true" aria-controls="memberSummary_tabpanel" tabindex="0" onkeydown="switchTab(event)" id="t0" class="activeTableTab">All Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t1" class="tableTab" onclick="show(1);">Static Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t2" class="tableTab" onclick="show(2);">Instance Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t4" class="tableTab" onclick="show(8);">Concrete Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t6" class="tableTab" onclick="show(32);">Deprecated Methods</button></div>
<div id="memberSummary_tabpanel" role="tabpanel">
<table aria-labelledby="t0">
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor" id="i0">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addShutdownHook(java.lang.Thread)">addShutdownHook</a></span>​(<a href="Thread.html" title="class in java.lang">Thread</a> hook)</code></th>
<td class="colLast">
<div class="block">Registers a new virtual-machine shutdown hook.</div>
</td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#availableProcessors()">availableProcessors</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the number of processors available to the Java virtual machine.</div>
</td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code><a href="Process.html" title="class in java.lang">Process</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#exec(java.lang.String)">exec</a></span>​(<a href="String.html" title="class in java.lang">String</a> command)</code></th>
<td class="colLast">
<div class="block">Executes the specified string command in a separate process.</div>
</td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code><a href="Process.html" title="class in java.lang">Process</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#exec(java.lang.String%5B%5D)">exec</a></span>​(<a href="String.html" title="class in java.lang">String</a>[] cmdarray)</code></th>
<td class="colLast">
<div class="block">Executes the specified command and arguments in a separate process.</div>
</td>
</tr>
<tr class="altColor" id="i4">
<td class="colFirst"><code><a href="Process.html" title="class in java.lang">Process</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#exec(java.lang.String%5B%5D,java.lang.String%5B%5D)">exec</a></span>​(<a href="String.html" title="class in java.lang">String</a>[] cmdarray,
<a href="String.html" title="class in java.lang">String</a>[] envp)</code></th>
<td class="colLast">
<div class="block">Executes the specified command and arguments in a separate process
with the specified environment.</div>
</td>
</tr>
<tr class="rowColor" id="i5">
<td class="colFirst"><code><a href="Process.html" title="class in java.lang">Process</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#exec(java.lang.String%5B%5D,java.lang.String%5B%5D,java.io.File)">exec</a></span>​(<a href="String.html" title="class in java.lang">String</a>[] cmdarray,
<a href="String.html" title="class in java.lang">String</a>[] envp,
<a href="../io/File.html" title="class in java.io">File</a> dir)</code></th>
<td class="colLast">
<div class="block">Executes the specified command and arguments in a separate process with
the specified environment and working directory.</div>
</td>
</tr>
<tr class="altColor" id="i6">
<td class="colFirst"><code><a href="Process.html" title="class in java.lang">Process</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#exec(java.lang.String,java.lang.String%5B%5D)">exec</a></span>​(<a href="String.html" title="class in java.lang">String</a> command,
<a href="String.html" title="class in java.lang">String</a>[] envp)</code></th>
<td class="colLast">
<div class="block">Executes the specified string command in a separate process with the
specified environment.</div>
</td>
</tr>
<tr class="rowColor" id="i7">
<td class="colFirst"><code><a href="Process.html" title="class in java.lang">Process</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#exec(java.lang.String,java.lang.String%5B%5D,java.io.File)">exec</a></span>​(<a href="String.html" title="class in java.lang">String</a> command,
<a href="String.html" title="class in java.lang">String</a>[] envp,
<a href="../io/File.html" title="class in java.io">File</a> dir)</code></th>
<td class="colLast">
<div class="block">Executes the specified string command in a separate process with the
specified environment and working directory.</div>
</td>
</tr>
<tr class="altColor" id="i8">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#exit(int)">exit</a></span>​(int status)</code></th>
<td class="colLast">
<div class="block">Terminates the currently running Java virtual machine by initiating its
shutdown sequence.</div>
</td>
</tr>
<tr class="rowColor" id="i9">
<td class="colFirst"><code>long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#freeMemory()">freeMemory</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the amount of free memory in the Java Virtual Machine.</div>
</td>
</tr>
<tr class="altColor" id="i10">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#gc()">gc</a></span>()</code></th>
<td class="colLast">
<div class="block">Runs the garbage collector.</div>
</td>
</tr>
<tr class="rowColor" id="i11">
<td class="colFirst"><code>static <a href="Runtime.html" title="class in java.lang">Runtime</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getRuntime()">getRuntime</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the runtime object associated with the current Java application.</div>
</td>
</tr>
<tr class="altColor" id="i12">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#halt(int)">halt</a></span>​(int status)</code></th>
<td class="colLast">
<div class="block">Forcibly terminates the currently running Java virtual machine.</div>
</td>
</tr>
<tr class="rowColor" id="i13">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#load(java.lang.String)">load</a></span>​(<a href="String.html" title="class in java.lang">String</a> filename)</code></th>
<td class="colLast">
<div class="block">Loads the native library specified by the filename argument.</div>
</td>
</tr>
<tr class="altColor" id="i14">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#loadLibrary(java.lang.String)">loadLibrary</a></span>​(<a href="String.html" title="class in java.lang">String</a> libname)</code></th>
<td class="colLast">
<div class="block">Loads the native library specified by the <code>libname</code>
argument.</div>
</td>
</tr>
<tr class="rowColor" id="i15">
<td class="colFirst"><code>long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#maxMemory()">maxMemory</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the maximum amount of memory that the Java virtual machine
will attempt to use.</div>
</td>
</tr>
<tr class="altColor" id="i16">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeShutdownHook(java.lang.Thread)">removeShutdownHook</a></span>​(<a href="Thread.html" title="class in java.lang">Thread</a> hook)</code></th>
<td class="colLast">
<div class="block">De-registers a previously-registered virtual-machine shutdown hook.</div>
</td>
</tr>
<tr class="rowColor" id="i17">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#runFinalization()">runFinalization</a></span>()</code></th>
<td class="colLast">
<div class="block">Runs the finalization methods of any objects pending finalization.</div>
</td>
</tr>
<tr class="altColor" id="i18">
<td class="colFirst"><code>long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#totalMemory()">totalMemory</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the total amount of memory in the Java virtual machine.</div>
</td>
</tr>
<tr class="rowColor" id="i19">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#traceInstructions(boolean)">traceInstructions</a></span>​(boolean on)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated, for removal: This API element is subject to removal in a future version.</span>
<div class="deprecationComment">This method was intended to control instruction tracing.</div>
</div>
</td>
</tr>
<tr class="altColor" id="i20">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#traceMethodCalls(boolean)">traceMethodCalls</a></span>​(boolean on)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated, for removal: This API element is subject to removal in a future version.</span>
<div class="deprecationComment">This method was intended to control method call tracing.</div>
</div>
</td>
</tr>
<tr class="rowColor" id="i21">
<td class="colFirst"><code>static <a href="Runtime.Version.html" title="class in java.lang">Runtime.Version</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#version()">version</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the version of the Java Runtime Environment as a <a href="Runtime.Version.html" title="class in java.lang"><code>Runtime.Version</code></a>.</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods declared in class java.lang.<a href="Object.html" title="class in java.lang">Object</a></h3>
<code><a href="Object.html#clone()">clone</a>, <a href="Object.html#equals(java.lang.Object)">equals</a>, <a href="Object.html#finalize()">finalize</a>, <a href="Object.html#getClass()">getClass</a>, <a href="Object.html#hashCode()">hashCode</a>, <a href="Object.html#notify()">notify</a>, <a href="Object.html#notifyAll()">notifyAll</a>, <a href="Object.html#toString()">toString</a>, <a href="Object.html#wait()">wait</a>, <a href="Object.html#wait(long)">wait</a>, <a href="Object.html#wait(long,int)">wait</a></code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="getRuntime()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRuntime</h4>
<pre class="methodSignature">public static <a href="Runtime.html" title="class in java.lang">Runtime</a> getRuntime()</pre>
<div class="block">Returns the runtime object associated with the current Java application.
Most of the methods of class <code>Runtime</code> are instance
methods and must be invoked with respect to the current runtime object.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <code>Runtime</code> object associated with the current
Java application.</dd>
</dl>
</li>
</ul>
<a id="exit(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>exit</h4>
<pre class="methodSignature">public void exit​(int status)</pre>
<div class="block">Terminates the currently running Java virtual machine by initiating its
shutdown sequence. This method never returns normally. The argument
serves as a status code; by convention, a nonzero status code indicates
abnormal termination.
<p> All registered <a href="#addShutdownHook(java.lang.Thread)">shutdown hooks</a>, if any,
are started in some unspecified order and allowed to run concurrently
until they finish. Once this is done the virtual machine
<a href="#halt(int)">halts</a>.
<p> If this method is invoked after all shutdown hooks have already
been run and the status is nonzero then this method halts the
virtual machine with the given status code. Otherwise, this method
blocks indefinitely.
<p> The <a href="System.html#exit(int)"><code>System.exit</code></a> method is the
conventional and convenient means of invoking this method.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>status</code> - Termination status. By convention, a nonzero status code
indicates abnormal termination.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="SecurityException.html" title="class in java.lang">SecurityException</a></code> - If a security manager is present and its
<a href="SecurityManager.html#checkExit(int)"><code>checkExit</code></a> method does not permit
exiting with the specified status</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="SecurityException.html" title="class in java.lang"><code>SecurityException</code></a>,
<a href="SecurityManager.html#checkExit(int)"><code>SecurityManager.checkExit(int)</code></a>,
<a href="#addShutdownHook(java.lang.Thread)"><code>addShutdownHook(java.lang.Thread)</code></a>,
<a href="#removeShutdownHook(java.lang.Thread)"><code>removeShutdownHook(java.lang.Thread)</code></a>,
<a href="#halt(int)"><code>halt(int)</code></a></dd>
</dl>
</li>
</ul>
<a id="addShutdownHook(java.lang.Thread)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addShutdownHook</h4>
<pre class="methodSignature">public void addShutdownHook​(<a href="Thread.html" title="class in java.lang">Thread</a> hook)</pre>
<div class="block">Registers a new virtual-machine shutdown hook.
<p> The Java virtual machine <i>shuts down</i> in response to two kinds
of events:
<ul>
<li> The program <i>exits</i> normally, when the last non-daemon
thread exits or when the <a href="#exit(int)"><code>exit</code></a> (equivalently,
<a href="System.html#exit(int)"><code>System.exit</code></a>) method is invoked, or
<li> The virtual machine is <i>terminated</i> in response to a
user interrupt, such as typing <code>^C</code>, or a system-wide event,
such as user logoff or system shutdown.
</ul>
<p> A <i>shutdown hook</i> is simply an initialized but unstarted
thread. When the virtual machine begins its shutdown sequence it will
start all registered shutdown hooks in some unspecified order and let
them run concurrently. When all the hooks have finished it will then
halt. Note that daemon threads will continue to run during the shutdown
sequence, as will non-daemon threads if shutdown was initiated by
invoking the <a href="#exit(int)"><code>exit</code></a> method.
<p> Once the shutdown sequence has begun it can be stopped only by
invoking the <a href="#halt(int)"><code>halt</code></a> method, which forcibly
terminates the virtual machine.
<p> Once the shutdown sequence has begun it is impossible to register a
new shutdown hook or de-register a previously-registered hook.
Attempting either of these operations will cause an
<a href="IllegalStateException.html" title="class in java.lang"><code>IllegalStateException</code></a> to be thrown.
<p> Shutdown hooks run at a delicate time in the life cycle of a virtual
machine and should therefore be coded defensively. They should, in
particular, be written to be thread-safe and to avoid deadlocks insofar
as possible. They should also not rely blindly upon services that may
have registered their own shutdown hooks and therefore may themselves in
the process of shutting down. Attempts to use other thread-based
services such as the AWT event-dispatch thread, for example, may lead to
deadlocks.
<p> Shutdown hooks should also finish their work quickly. When a
program invokes <a href="#exit(int)"><code>exit</code></a> the expectation is
that the virtual machine will promptly shut down and exit. When the
virtual machine is terminated due to user logoff or system shutdown the
underlying operating system may only allow a fixed amount of time in
which to shut down and exit. It is therefore inadvisable to attempt any
user interaction or to perform a long-running computation in a shutdown
hook.
<p> Uncaught exceptions are handled in shutdown hooks just as in any
other thread, by invoking the
<a href="ThreadGroup.html#uncaughtException(java.lang.Thread,java.lang.Throwable)"><code>uncaughtException</code></a> method of the
thread's <a href="ThreadGroup.html" title="class in java.lang"><code>ThreadGroup</code></a> object. The default implementation of this
method prints the exception's stack trace to <a href="System.html#err"><code>System.err</code></a> and
terminates the thread; it does not cause the virtual machine to exit or
halt.
<p> In rare circumstances the virtual machine may <i>abort</i>, that is,
stop running without shutting down cleanly. This occurs when the
virtual machine is terminated externally, for example with the
<code>SIGKILL</code> signal on Unix or the <code>TerminateProcess</code> call on
Microsoft Windows. The virtual machine may also abort if a native
method goes awry by, for example, corrupting internal data structures or
attempting to access nonexistent memory. If the virtual machine aborts
then no guarantee can be made about whether or not any shutdown hooks
will be run.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>hook</code> - An initialized but unstarted <a href="Thread.html" title="class in java.lang"><code>Thread</code></a> object</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - If the specified hook has already been registered,
or if it can be determined that the hook is already running or
has already been run</dd>
<dd><code><a href="IllegalStateException.html" title="class in java.lang">IllegalStateException</a></code> - If the virtual machine is already in the process
of shutting down</dd>
<dd><code><a href="SecurityException.html" title="class in java.lang">SecurityException</a></code> - If a security manager is present and it denies
<a href="RuntimePermission.html" title="class in java.lang"><code>RuntimePermission</code></a>("shutdownHooks")</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.3</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#removeShutdownHook(java.lang.Thread)"><code>removeShutdownHook(java.lang.Thread)</code></a>,
<a href="#halt(int)"><code>halt(int)</code></a>,
<a href="#exit(int)"><code>exit(int)</code></a></dd>
</dl>
</li>
</ul>
<a id="removeShutdownHook(java.lang.Thread)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeShutdownHook</h4>
<pre class="methodSignature">public boolean removeShutdownHook​(<a href="Thread.html" title="class in java.lang">Thread</a> hook)</pre>
<div class="block">De-registers a previously-registered virtual-machine shutdown hook.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>hook</code> - the hook to remove</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if the specified hook had previously been
registered and was successfully de-registered, <code>false</code>
otherwise.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="IllegalStateException.html" title="class in java.lang">IllegalStateException</a></code> - If the virtual machine is already in the process of shutting
down</dd>
<dd><code><a href="SecurityException.html" title="class in java.lang">SecurityException</a></code> - If a security manager is present and it denies
<a href="RuntimePermission.html" title="class in java.lang"><code>RuntimePermission</code></a>("shutdownHooks")</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.3</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#addShutdownHook(java.lang.Thread)"><code>addShutdownHook(java.lang.Thread)</code></a>,
<a href="#exit(int)"><code>exit(int)</code></a></dd>
</dl>
</li>
</ul>
<a id="halt(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>halt</h4>
<pre class="methodSignature">public void halt​(int status)</pre>
<div class="block">Forcibly terminates the currently running Java virtual machine. This
method never returns normally.
<p> This method should be used with extreme caution. Unlike the
<a href="#exit(int)"><code>exit</code></a> method, this method does not cause shutdown
hooks to be started. If the shutdown sequence has already been
initiated then this method does not wait for any running
shutdown hooks to finish their work.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>status</code> - Termination status. By convention, a nonzero status code
indicates abnormal termination. If the <a href="#exit(int)"><code>exit</code></a>
(equivalently, <a href="System.html#exit(int)"><code>System.exit</code></a>) method
has already been invoked then this status code
will override the status code passed to that method.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="SecurityException.html" title="class in java.lang">SecurityException</a></code> - If a security manager is present and its
<a href="SecurityManager.html#checkExit(int)"><code>checkExit</code></a> method
does not permit an exit with the specified status</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.3</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#exit(int)"><code>exit(int)</code></a>,
<a href="#addShutdownHook(java.lang.Thread)"><code>addShutdownHook(java.lang.Thread)</code></a>,
<a href="#removeShutdownHook(java.lang.Thread)"><code>removeShutdownHook(java.lang.Thread)</code></a></dd>
</dl>
</li>
</ul>
<a id="exec(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>exec</h4>
<pre class="methodSignature">public <a href="Process.html" title="class in java.lang">Process</a> exec​(<a href="String.html" title="class in java.lang">String</a> command)
throws <a href="../io/IOException.html" title="class in java.io">IOException</a></pre>
<div class="block">Executes the specified string command in a separate process.
<p>This is a convenience method. An invocation of the form
<code>exec(command)</code>
behaves in exactly the same way as the invocation
<a href="#exec(java.lang.String,java.lang.String%5B%5D,java.io.File)"><code>exec</code></a><code>(command, null, null)</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>command</code> - a specified system command.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A new <a href="Process.html" title="class in java.lang"><code>Process</code></a> object for managing the subprocess</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="SecurityException.html" title="class in java.lang">SecurityException</a></code> - If a security manager exists and its
<a href="SecurityManager.html#checkExec(java.lang.String)"><code>checkExec</code></a>
method doesn't allow creation of the subprocess</dd>
<dd><code><a href="../io/IOException.html" title="class in java.io">IOException</a></code> - If an I/O error occurs</dd>
<dd><code><a href="NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - If <code>command</code> is <code>null</code></dd>
<dd><code><a href="IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - If <code>command</code> is empty</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#exec(java.lang.String%5B%5D,java.lang.String%5B%5D,java.io.File)"><code>exec(String[], String[], File)</code></a>,
<a href="ProcessBuilder.html" title="class in java.lang"><code>ProcessBuilder</code></a></dd>
</dl>
</li>
</ul>
<a id="exec(java.lang.String,java.lang.String[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>exec</h4>
<pre class="methodSignature">public <a href="Process.html" title="class in java.lang">Process</a> exec​(<a href="String.html" title="class in java.lang">String</a> command,
<a href="String.html" title="class in java.lang">String</a>[] envp)
throws <a href="../io/IOException.html" title="class in java.io">IOException</a></pre>
<div class="block">Executes the specified string command in a separate process with the
specified environment.
<p>This is a convenience method. An invocation of the form
<code>exec(command, envp)</code>
behaves in exactly the same way as the invocation
<a href="#exec(java.lang.String,java.lang.String%5B%5D,java.io.File)"><code>exec</code></a><code>(command, envp, null)</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>command</code> - a specified system command.</dd>
<dd><code>envp</code> - array of strings, each element of which
has environment variable settings in the format
<i>name</i>=<i>value</i>, or
<code>null</code> if the subprocess should inherit
the environment of the current process.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A new <a href="Process.html" title="class in java.lang"><code>Process</code></a> object for managing the subprocess</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="SecurityException.html" title="class in java.lang">SecurityException</a></code> - If a security manager exists and its
<a href="SecurityManager.html#checkExec(java.lang.String)"><code>checkExec</code></a>
method doesn't allow creation of the subprocess</dd>
<dd><code><a href="../io/IOException.html" title="class in java.io">IOException</a></code> - If an I/O error occurs</dd>
<dd><code><a href="NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - If <code>command</code> is <code>null</code>,
or one of the elements of <code>envp</code> is <code>null</code></dd>
<dd><code><a href="IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - If <code>command</code> is empty</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#exec(java.lang.String%5B%5D,java.lang.String%5B%5D,java.io.File)"><code>exec(String[], String[], File)</code></a>,
<a href="ProcessBuilder.html" title="class in java.lang"><code>ProcessBuilder</code></a></dd>
</dl>
</li>
</ul>
<a id="exec(java.lang.String,java.lang.String[],java.io.File)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>exec</h4>
<pre class="methodSignature">public <a href="Process.html" title="class in java.lang">Process</a> exec​(<a href="String.html" title="class in java.lang">String</a> command,
<a href="String.html" title="class in java.lang">String</a>[] envp,
<a href="../io/File.html" title="class in java.io">File</a> dir)
throws <a href="../io/IOException.html" title="class in java.io">IOException</a></pre>
<div class="block">Executes the specified string command in a separate process with the
specified environment and working directory.
<p>This is a convenience method. An invocation of the form
<code>exec(command, envp, dir)</code>
behaves in exactly the same way as the invocation
<a href="#exec(java.lang.String%5B%5D,java.lang.String%5B%5D,java.io.File)"><code>exec</code></a><code>(cmdarray, envp, dir)</code>,
where <code>cmdarray</code> is an array of all the tokens in
<code>command</code>.
<p>More precisely, the <code>command</code> string is broken
into tokens using a <a href="../util/StringTokenizer.html" title="class in java.util"><code>StringTokenizer</code></a> created by the call
<code>new {@link StringTokenizer}(command)</code> with no
further modification of the character categories. The tokens
produced by the tokenizer are then placed in the new string
array <code>cmdarray</code>, in the same order.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>command</code> - a specified system command.</dd>
<dd><code>envp</code> - array of strings, each element of which
has environment variable settings in the format
<i>name</i>=<i>value</i>, or
<code>null</code> if the subprocess should inherit
the environment of the current process.</dd>
<dd><code>dir</code> - the working directory of the subprocess, or
<code>null</code> if the subprocess should inherit
the working directory of the current process.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A new <a href="Process.html" title="class in java.lang"><code>Process</code></a> object for managing the subprocess</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="SecurityException.html" title="class in java.lang">SecurityException</a></code> - If a security manager exists and its
<a href="SecurityManager.html#checkExec(java.lang.String)"><code>checkExec</code></a>
method doesn't allow creation of the subprocess</dd>
<dd><code><a href="../io/IOException.html" title="class in java.io">IOException</a></code> - If an I/O error occurs</dd>
<dd><code><a href="NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - If <code>command</code> is <code>null</code>,
or one of the elements of <code>envp</code> is <code>null</code></dd>
<dd><code><a href="IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - If <code>command</code> is empty</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.3</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="ProcessBuilder.html" title="class in java.lang"><code>ProcessBuilder</code></a></dd>
</dl>
</li>
</ul>
<a id="exec(java.lang.String[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>exec</h4>
<pre class="methodSignature">public <a href="Process.html" title="class in java.lang">Process</a> exec​(<a href="String.html" title="class in java.lang">String</a>[] cmdarray)
throws <a href="../io/IOException.html" title="class in java.io">IOException</a></pre>
<div class="block">Executes the specified command and arguments in a separate process.
<p>This is a convenience method. An invocation of the form
<code>exec(cmdarray)</code>
behaves in exactly the same way as the invocation
<a href="#exec(java.lang.String%5B%5D,java.lang.String%5B%5D,java.io.File)"><code>exec</code></a><code>(cmdarray, null, null)</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>cmdarray</code> - array containing the command to call and
its arguments.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A new <a href="Process.html" title="class in java.lang"><code>Process</code></a> object for managing the subprocess</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="SecurityException.html" title="class in java.lang">SecurityException</a></code> - If a security manager exists and its
<a href="SecurityManager.html#checkExec(java.lang.String)"><code>checkExec</code></a>
method doesn't allow creation of the subprocess</dd>
<dd><code><a href="../io/IOException.html" title="class in java.io">IOException</a></code> - If an I/O error occurs</dd>
<dd><code><a href="NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - If <code>cmdarray</code> is <code>null</code>,
or one of the elements of <code>cmdarray</code> is <code>null</code></dd>
<dd><code><a href="IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</a></code> - If <code>cmdarray</code> is an empty array
(has length <code>0</code>)</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="ProcessBuilder.html" title="class in java.lang"><code>ProcessBuilder</code></a></dd>
</dl>
</li>
</ul>
<a id="exec(java.lang.String[],java.lang.String[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>exec</h4>
<pre class="methodSignature">public <a href="Process.html" title="class in java.lang">Process</a> exec​(<a href="String.html" title="class in java.lang">String</a>[] cmdarray,
<a href="String.html" title="class in java.lang">String</a>[] envp)
throws <a href="../io/IOException.html" title="class in java.io">IOException</a></pre>
<div class="block">Executes the specified command and arguments in a separate process
with the specified environment.
<p>This is a convenience method. An invocation of the form
<code>exec(cmdarray, envp)</code>
behaves in exactly the same way as the invocation
<a href="#exec(java.lang.String%5B%5D,java.lang.String%5B%5D,java.io.File)"><code>exec</code></a><code>(cmdarray, envp, null)</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>cmdarray</code> - array containing the command to call and
its arguments.</dd>
<dd><code>envp</code> - array of strings, each element of which
has environment variable settings in the format
<i>name</i>=<i>value</i>, or
<code>null</code> if the subprocess should inherit
the environment of the current process.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A new <a href="Process.html" title="class in java.lang"><code>Process</code></a> object for managing the subprocess</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="SecurityException.html" title="class in java.lang">SecurityException</a></code> - If a security manager exists and its
<a href="SecurityManager.html#checkExec(java.lang.String)"><code>checkExec</code></a>
method doesn't allow creation of the subprocess</dd>
<dd><code><a href="../io/IOException.html" title="class in java.io">IOException</a></code> - If an I/O error occurs</dd>
<dd><code><a href="NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - If <code>cmdarray</code> is <code>null</code>,
or one of the elements of <code>cmdarray</code> is <code>null</code>,
or one of the elements of <code>envp</code> is <code>null</code></dd>
<dd><code><a href="IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</a></code> - If <code>cmdarray</code> is an empty array
(has length <code>0</code>)</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="ProcessBuilder.html" title="class in java.lang"><code>ProcessBuilder</code></a></dd>
</dl>
</li>
</ul>
<a id="exec(java.lang.String[],java.lang.String[],java.io.File)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>exec</h4>
<pre class="methodSignature">public <a href="Process.html" title="class in java.lang">Process</a> exec​(<a href="String.html" title="class in java.lang">String</a>[] cmdarray,
<a href="String.html" title="class in java.lang">String</a>[] envp,
<a href="../io/File.html" title="class in java.io">File</a> dir)
throws <a href="../io/IOException.html" title="class in java.io">IOException</a></pre>
<div class="block">Executes the specified command and arguments in a separate process with
the specified environment and working directory.
<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 "environment" variable settings, this method creates
a new process in which to execute the specified command.
<p>This method checks that <code>cmdarray</code> is a valid operating
system command. Which commands are valid is system-dependent,
but at the very least the command must be a non-empty list of
non-null strings.
<p>If <code>envp</code> is <code>null</code>, the subprocess inherits the
environment settings of the current process.
<p>A minimal set of system dependent environment variables may
be required to start a process on some operating systems.
As a result, the subprocess may inherit additional environment variable
settings beyond those in the specified environment.
<p><a href="ProcessBuilder.html#start()"><code>ProcessBuilder.start()</code></a> is now the preferred way to
start a process with a modified environment.
<p>The working directory of the new subprocess is specified by <code>dir</code>.
If <code>dir</code> is <code>null</code>, the subprocess inherits the
current working directory of the current process.
<p>If a security manager exists, its
<a href="SecurityManager.html#checkExec(java.lang.String)"><code>checkExec</code></a>
method is invoked with the first component of the array
<code>cmdarray</code> as its argument. This may result in a
<a href="SecurityException.html" title="class in java.lang"><code>SecurityException</code></a> being thrown.
<p>Starting an operating system process is highly system-dependent.
Among the many things that can go wrong are:
<ul>
<li>The operating system program file was not found.
<li>Access to the program file was denied.
<li>The working directory does not exist.
</ul>
<p>In such cases an exception will be thrown. The exact nature
of the exception is system-dependent, but it will always be a
subclass of <a href="../io/IOException.html" title="class in java.io"><code>IOException</code></a>.
<p>If the operating system does not support the creation of
processes, an <a href="UnsupportedOperationException.html" title="class in java.lang"><code>UnsupportedOperationException</code></a> will be thrown.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>cmdarray</code> - array containing the command to call and
its arguments.</dd>
<dd><code>envp</code> - array of strings, each element of which
has environment variable settings in the format
<i>name</i>=<i>value</i>, or
<code>null</code> if the subprocess should inherit
the environment of the current process.</dd>
<dd><code>dir</code> - the working directory of the subprocess, or
<code>null</code> if the subprocess should inherit
the working directory of the current process.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A new <a href="Process.html" title="class in java.lang"><code>Process</code></a> object for managing the subprocess</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="SecurityException.html" title="class in java.lang">SecurityException</a></code> - If a security manager exists and its
<a href="SecurityManager.html#checkExec(java.lang.String)"><code>checkExec</code></a>
method doesn't allow creation of the subprocess</dd>
<dd><code><a href="UnsupportedOperationException.html" title="class in java.lang">UnsupportedOperationException</a></code> - If the operating system does not support the creation of processes.</dd>
<dd><code><a href="../io/IOException.html" title="class in java.io">IOException</a></code> - If an I/O error occurs</dd>
<dd><code><a href="NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - If <code>cmdarray</code> is <code>null</code>,
or one of the elements of <code>cmdarray</code> is <code>null</code>,
or one of the elements of <code>envp</code> is <code>null</code></dd>
<dd><code><a href="IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</a></code> - If <code>cmdarray</code> is an empty array
(has length <code>0</code>)</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.3</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="ProcessBuilder.html" title="class in java.lang"><code>ProcessBuilder</code></a></dd>
</dl>
</li>
</ul>
<a id="availableProcessors()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>availableProcessors</h4>
<pre class="methodSignature">public int availableProcessors()</pre>
<div class="block">Returns the number of processors available to the Java virtual machine.
<p> This value may change during a particular invocation of the virtual
machine. Applications that are sensitive to the number of available
processors should therefore occasionally poll this property and adjust
their resource usage appropriately. </p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the maximum number of processors available to the virtual
machine; never smaller than one</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.4</dd>
</dl>
</li>
</ul>
<a id="freeMemory()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>freeMemory</h4>
<pre class="methodSignature">public long freeMemory()</pre>
<div class="block">Returns the amount of free memory in the Java Virtual Machine.
Calling the
<code>gc</code> method may result in increasing the value returned
by <code>freeMemory.</code></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an approximation to the total amount of memory currently
available for future allocated objects, measured in bytes.</dd>
</dl>
</li>
</ul>
<a id="totalMemory()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>totalMemory</h4>
<pre class="methodSignature">public long totalMemory()</pre>
<div class="block">Returns the total amount of memory in the Java virtual machine.
The value returned by this method may vary over time, depending on
the host environment.
<p>
Note that the amount of memory required to hold an object of any
given type may be implementation-dependent.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the total amount of memory currently available for current
and future objects, measured in bytes.</dd>
</dl>
</li>
</ul>
<a id="maxMemory()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>maxMemory</h4>
<pre class="methodSignature">public long maxMemory()</pre>
<div class="block">Returns the maximum amount of memory that the Java virtual machine
will attempt to use. If there is no inherent limit then the value
<a href="Long.html#MAX_VALUE"><code>Long.MAX_VALUE</code></a> will be returned.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the maximum amount of memory that the virtual machine will
attempt to use, measured in bytes</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.4</dd>
</dl>
</li>
</ul>
<a id="gc()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>gc</h4>
<pre class="methodSignature">public void gc()</pre>
<div class="block">Runs the garbage collector.
Calling this method suggests that the Java virtual machine expend