author | herrick |
Sun, 07 Jul 2019 19:40:48 -0400 | |
branch | JDK-8200758-branch |
changeset 57455 | f1290ca0fee6 |
parent 57323 | 66c1dbc008c5 |
permissions | -rw-r--r-- |
57064
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
1 |
/* |
57106
ea870b9ce89a
8216492: Update copyright of all new jpackage fils to 2019
kcr
parents:
57099
diff
changeset
|
2 |
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. |
57064
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
4 |
* |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. Oracle designates this |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
10 |
* |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
15 |
* accompanied this code). |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
16 |
* |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
20 |
* |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
22 |
* or visit www.oracle.com if you need additional information or have any |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
23 |
* questions. |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
24 |
*/ |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
25 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
26 |
#include "JavaVirtualMachine.h" |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
27 |
#include "Platform.h" |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
28 |
#include "PlatformString.h" |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
29 |
#include "FilePath.h" |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
30 |
#include "Package.h" |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
31 |
#include "Helpers.h" |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
32 |
#include "Messages.h" |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
33 |
#include "Macros.h" |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
34 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
35 |
#include "jni.h" |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
36 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
37 |
#include <map> |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
38 |
#include <list> |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
39 |
#include <sstream> |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
40 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
41 |
|
57099
9a85a7a076ad
8216190: Remove Single Instance Service support from jpackage
herrick
parents:
57064
diff
changeset
|
42 |
bool RunVM() { |
57064
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
43 |
JavaVirtualMachine javavm; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
44 |
|
57099
9a85a7a076ad
8216190: Remove Single Instance Service support from jpackage
herrick
parents:
57064
diff
changeset
|
45 |
bool result = javavm.StartJVM(); |
57064
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
46 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
47 |
if (!result) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
48 |
Platform& platform = Platform::GetInstance(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
49 |
platform.ShowMessage(_T("Failed to launch JVM\n")); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
50 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
51 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
52 |
return result; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
53 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
54 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
55 |
//---------------------------------------------------------------------------- |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
56 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
57 |
JavaOptions::JavaOptions(): FOptions(NULL) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
58 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
59 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
60 |
JavaOptions::~JavaOptions() { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
61 |
if (FOptions != NULL) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
62 |
for (unsigned int index = 0; index < GetCount(); index++) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
63 |
delete[] FOptions[index].optionString; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
64 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
65 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
66 |
delete[] FOptions; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
67 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
68 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
69 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
70 |
void JavaOptions::AppendValue(const TString Key, TString Value, void* Extra) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
71 |
JavaOptionItem item; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
72 |
item.name = Key; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
73 |
item.value = Value; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
74 |
item.extraInfo = Extra; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
75 |
FItems.push_back(item); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
76 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
77 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
78 |
void JavaOptions::AppendValue(const TString Key, TString Value) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
79 |
AppendValue(Key, Value, NULL); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
80 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
81 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
82 |
void JavaOptions::AppendValue(const TString Key) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
83 |
AppendValue(Key, _T(""), NULL); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
84 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
85 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
86 |
void JavaOptions::AppendValues(OrderedMap<TString, TString> Values) { |
57455
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
87 |
if (Values.GetAllowDuplicates()) { |
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
88 |
for (int i = 0; i < (int)Values.Count(); i++) { |
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
89 |
TString name, value; |
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
90 |
|
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
91 |
bool bResult = Values.GetKey(i, name); |
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
92 |
bResult &= Values.GetValue(i, value); |
57064
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
93 |
|
57455
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
94 |
if (bResult) { |
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
95 |
AppendValue(name, value); |
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
96 |
} |
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
97 |
} |
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
98 |
} else { // In case we asked to add values from OrderedMap with allow |
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
99 |
// duplicates set to false. Not used now, but should avoid possible |
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
100 |
// bugs. |
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
101 |
std::vector<TString> orderedKeys = Values.GetKeys(); |
57064
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
102 |
|
57455
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
103 |
for (std::vector<TString>::const_iterator iterator = orderedKeys.begin(); |
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
104 |
iterator != orderedKeys.end(); iterator++) { |
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
105 |
TString name = *iterator; |
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
106 |
TString value; |
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
107 |
|
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
108 |
if (Values.GetValue(name, value) == true) { |
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
109 |
AppendValue(name, value); |
f1290ca0fee6
8227058: Regressions related to no longer setting user.dir
herrick
parents:
57323
diff
changeset
|
110 |
} |
57064
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
111 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
112 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
113 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
114 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
115 |
void JavaOptions::ReplaceValue(const TString Key, TString Value) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
116 |
for (std::list<JavaOptionItem>::iterator iterator = FItems.begin(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
117 |
iterator != FItems.end(); iterator++) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
118 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
119 |
TString lkey = iterator->name; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
120 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
121 |
if (lkey == Key) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
122 |
JavaOptionItem item = *iterator; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
123 |
item.value = Value; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
124 |
iterator = FItems.erase(iterator); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
125 |
FItems.insert(iterator, item); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
126 |
break; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
127 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
128 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
129 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
130 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
131 |
std::list<TString> JavaOptions::ToList() { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
132 |
std::list<TString> result; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
133 |
Macros& macros = Macros::GetInstance(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
134 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
135 |
for (std::list<JavaOptionItem>::const_iterator iterator = FItems.begin(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
136 |
iterator != FItems.end(); iterator++) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
137 |
TString key = iterator->name; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
138 |
TString value = iterator->value; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
139 |
TString option = Helpers::NameValueToString(key, value); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
140 |
option = macros.ExpandMacros(option); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
141 |
result.push_back(option); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
142 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
143 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
144 |
return result; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
145 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
146 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
147 |
size_t JavaOptions::GetCount() { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
148 |
return FItems.size(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
149 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
150 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
151 |
//---------------------------------------------------------------------------- |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
152 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
153 |
JavaVirtualMachine::JavaVirtualMachine() { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
154 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
155 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
156 |
JavaVirtualMachine::~JavaVirtualMachine(void) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
157 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
158 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
159 |
bool JavaVirtualMachine::StartJVM() { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
160 |
Platform& platform = Platform::GetInstance(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
161 |
Package& package = Package::GetInstance(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
162 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
163 |
TString classpath = package.GetClassPath(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
164 |
TString modulepath = package.GetModulePath(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
165 |
JavaOptions options; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
166 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
167 |
if (modulepath.empty() == false) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
168 |
options.AppendValue(_T("-Djava.module.path"), modulepath); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
169 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
170 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
171 |
options.AppendValue(_T("-Djava.library.path"), |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
172 |
package.GetPackageAppDirectory() + FilePath::PathSeparator() |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
173 |
+ package.GetPackageLauncherDirectory()); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
174 |
options.AppendValue( |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
175 |
_T("-Djava.launcher.path"), package.GetPackageLauncherDirectory()); |
57316 | 176 |
options.AppendValues(package.GetJavaOptions()); |
57064
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
177 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
178 |
#ifdef DEBUG |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
179 |
if (package.Debugging() == dsJava) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
180 |
options.AppendValue(_T("-Xdebug"), _T("")); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
181 |
options.AppendValue( |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
182 |
_T("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=localhost:5005"), |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
183 |
_T("")); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
184 |
platform.ShowMessage(_T("localhost:5005")); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
185 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
186 |
#endif // DEBUG |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
187 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
188 |
TString maxHeapSizeOption; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
189 |
TString minHeapSizeOption; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
190 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
191 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
192 |
if (package.GetMemoryState() == PackageBootFields::msAuto) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
193 |
TPlatformNumber memorySize = package.GetMemorySize(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
194 |
TString memory = |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
195 |
PlatformString((size_t)memorySize).toString() + _T("m"); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
196 |
maxHeapSizeOption = TString(_T("-Xmx")) + memory; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
197 |
options.AppendValue(maxHeapSizeOption, _T("")); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
198 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
199 |
if (memorySize > 256) |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
200 |
minHeapSizeOption = _T("-Xms256m"); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
201 |
else |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
202 |
minHeapSizeOption = _T("-Xms") + memory; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
203 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
204 |
options.AppendValue(minHeapSizeOption, _T("")); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
205 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
206 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
207 |
TString mainClassName = package.GetMainClassName(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
208 |
TString mainModule = package.GetMainModule(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
209 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
210 |
if (mainClassName.empty() == true && mainModule.empty() == true) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
211 |
Messages& messages = Messages::GetInstance(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
212 |
platform.ShowMessage(messages.GetMessage(NO_MAIN_CLASS_SPECIFIED)); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
213 |
return false; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
214 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
215 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
216 |
configureLibrary(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
217 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
218 |
// Initialize the arguments to JLI_Launch() |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
219 |
// |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
220 |
// On Mac OS X JLI_Launch spawns a new thread that actually starts the JVM. |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
221 |
// This new thread simply re-runs main(argc, argv). Therefore we do not |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
222 |
// want to add new args if we are still in the original main thread so we |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
223 |
// will treat them as command line args provided by the user ... |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
224 |
// Only propagate original set of args first time. |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
225 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
226 |
options.AppendValue(_T("-classpath")); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
227 |
options.AppendValue(classpath); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
228 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
229 |
std::list<TString> vmargs; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
230 |
vmargs.push_back(package.GetCommandName()); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
231 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
232 |
if (package.HasSplashScreen() == true) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
233 |
options.AppendValue(TString(_T("-splash:")) |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
234 |
+ package.GetSplashScreenFileName(), _T("")); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
235 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
236 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
237 |
if (mainModule.empty() == true) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
238 |
options.AppendValue(Helpers::ConvertJavaPathToId(mainClassName), |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
239 |
_T("")); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
240 |
} else { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
241 |
options.AppendValue(_T("-m")); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
242 |
options.AppendValue(mainModule); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
243 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
244 |
|
57099
9a85a7a076ad
8216190: Remove Single Instance Service support from jpackage
herrick
parents:
57064
diff
changeset
|
245 |
return launchVM(options, vmargs); |
57064
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
246 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
247 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
248 |
void JavaVirtualMachine::configureLibrary() { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
249 |
Platform& platform = Platform::GetInstance(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
250 |
Package& package = Package::GetInstance(); |
57316 | 251 |
TString libName = package.GetJavaLibraryFileName(); |
57194
9d5fccd97421
8212091: Move jpackage native code under platform specific folders and files
herrick
parents:
57106
diff
changeset
|
252 |
platform.addPlatformDependencies(&javaLibrary); |
57064
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
253 |
javaLibrary.Load(libName); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
254 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
255 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
256 |
bool JavaVirtualMachine::launchVM(JavaOptions& options, |
57099
9a85a7a076ad
8216190: Remove Single Instance Service support from jpackage
herrick
parents:
57064
diff
changeset
|
257 |
std::list<TString>& vmargs) { |
57064
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
258 |
Platform& platform = Platform::GetInstance(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
259 |
Package& package = Package::GetInstance(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
260 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
261 |
#ifdef MAC |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
262 |
// Mac adds a ProcessSerialNumber to args when launched from .app |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
263 |
// filter out the psn since they it's not expected in the app |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
264 |
if (platform.IsMainThread() == false) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
265 |
std::list<TString> loptions = options.ToList(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
266 |
vmargs.splice(vmargs.end(), loptions, |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
267 |
loptions.begin(), loptions.end()); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
268 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
269 |
#else |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
270 |
std::list<TString> loptions = options.ToList(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
271 |
vmargs.splice(vmargs.end(), loptions, loptions.begin(), loptions.end()); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
272 |
#endif |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
273 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
274 |
std::list<TString> largs = package.GetArgs(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
275 |
vmargs.splice(vmargs.end(), largs, largs.begin(), largs.end()); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
276 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
277 |
size_t argc = vmargs.size(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
278 |
DynamicBuffer<char*> argv(argc + 1); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
279 |
if (argv.GetData() == NULL) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
280 |
return false; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
281 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
282 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
283 |
unsigned int index = 0; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
284 |
for (std::list<TString>::const_iterator iterator = vmargs.begin(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
285 |
iterator != vmargs.end(); iterator++) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
286 |
TString item = *iterator; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
287 |
std::string arg = PlatformString(item).toStdString(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
288 |
#ifdef DEBUG |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
289 |
printf("%i %s\n", index, arg.c_str()); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
290 |
#endif // DEBUG |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
291 |
argv[index] = PlatformString::duplicate(arg.c_str()); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
292 |
index++; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
293 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
294 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
295 |
argv[argc] = NULL; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
296 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
297 |
// On Mac we can only free the boot fields if the calling thread is |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
298 |
// not the main thread. |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
299 |
#ifdef MAC |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
300 |
if (platform.IsMainThread() == false) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
301 |
package.FreeBootFields(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
302 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
303 |
#else |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
304 |
package.FreeBootFields(); |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
305 |
#endif // MAC |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
306 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
307 |
if (javaLibrary.JavaVMCreate(argc, argv.GetData()) == true) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
308 |
return true; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
309 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
310 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
311 |
for (index = 0; index < argc; index++) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
312 |
if (argv[index] != NULL) { |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
313 |
delete[] argv[index]; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
314 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
315 |
} |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
316 |
|
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
317 |
return false; |
a7fdadf67a92
8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff
changeset
|
318 |
} |