< prev index next >
modules/fxpackager/src/main/native/library/common/JavaVirtualMachine.cpp
Print this page
rev 9619 : imported patch 9-jake-fxpackager.patch
@@ -227,10 +227,14 @@
void AppendValue(const TString Key, TString Value) {
AppendValue(Key, Value, NULL);
}
+ void AppendValue(const TString Key) {
+ AppendValue(Key, _T(""), NULL);
+ }
+
void AppendValues(OrderedMap<TString, TString> Values) {
std::vector<TString> orderedKeys = Values.GetKeys();
for (std::vector<TString>::const_iterator iterator = orderedKeys.begin(); iterator != orderedKeys.end(); iterator++) {
TString name = *iterator;
@@ -358,13 +362,17 @@
bool JavaVirtualMachine::StartJVM() {
Platform& platform = Platform::GetInstance();
Package& package = Package::GetInstance();
TString classpath = package.GetClassPath();
-
+ TString modulepath = package.GetModulePath();
JavaOptions options;
- options.AppendValue(_T("-Djava.class.path"), classpath);
+
+ if (modulepath.empty() == false) {
+ options.AppendValue(_T("-Djava.module.path"), modulepath);
+ }
+
options.AppendValue(_T("-Djava.library.path"), package.GetPackageAppDirectory() + FilePath::PathSeparator() + package.GetPackageLauncherDirectory());
options.AppendValue(_T("-Djava.launcher.path"), package.GetPackageLauncherDirectory());
options.AppendValue(_T("-Dapp.preferences.id"), package.GetAppID());
options.AppendValues(package.GetJVMArgs());
options.AppendValues(RemoveTrailingEquals(package.GetJVMUserArgs()));
@@ -416,10 +424,12 @@
#endif
javaLibrary.Load(package.GetJVMLibraryFileName());
#ifndef USE_JLI_LAUNCH
+ options.AppendValue(_T("-Djava.class.path"), classpath);
+
if (package.HasSplashScreen() == true) {
options.AppendValue(TString(_T("-splash:")) + package.GetSplashScreenFileName(), _T(""));
}
// Set up the VM init args
@@ -457,10 +467,13 @@
// new thread simply re-runs main(argc, argv). Therefore we do not want
// to add new args if we are still in the original main thread so we
// will treat them as command line args provided by the user ...
// Only propagate original set of args first time.
+ options.AppendValue(_T("-classpath"));
+ options.AppendValue(classpath);
+
std::list<TString> vmargs;
vmargs.push_back(package.GetCommandName());
if (package.HasSplashScreen() == true) {
options.AppendValue(TString(_T("-splash:")) + package.GetSplashScreenFileName(), _T(""));
< prev index next >