modules/jdk.packager/src/main/native/library/common/main.cpp

Print this page

        

*** 117,126 **** --- 117,136 ---- Package& package = Package::GetInstance(); Macros::Initialize(); package.SetCommandLineArguments(argc, argv); platform.SetCurrentDirectory(package.GetPackageAppDirectory()); + if (package.CheckForSingleInstance()) { + // reactivate the first instance if the process Id is valid + platform.reactivateAnotherInstance(); + if (package.GetArgs().size() > 0 && platform.GetSingleInstanceProcessId() != 0) { + // if user specified args, try to pass them to the first instance + return RunVM(SINGLE_INSTANCE_NOTIFICATION_LAUNCH); + } + return true; + } + switch (platform.GetAppCDSState()) { case cdsDisabled: case cdsUninitialized: case cdsEnabled: { break;
*** 190,202 **** case cdsUninitialized: { throw Exception(_T("Internal Error")); } } } - // Run App ! result = RunVM(); } catch (FileNotFoundException &e) { platform.ShowMessage(e.GetMessage()); } --- 200,211 ---- case cdsUninitialized: { throw Exception(_T("Internal Error")); } } } // Run App ! result = RunVM(USER_APP_LAUNCH); } catch (FileNotFoundException &e) { platform.ShowMessage(e.GetMessage()); }