This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
NBI currently doesn't support a bundled JRE with Mac OS X. This is very easy to fix. (I'll get to that) Why this is so, I don't know, but I'm assuming the reason is that at the time NBI was created the concept of a bundled JRE on Mac OS X was somewhat alien. At that time Mac OS X *always* came with a pre-installe JRE. Today Mac OS X comes without a JRE pre-installed and Apple actively encourages developers to bundle a private JRE with the application. In fact if you want your application in the Mac App Store then you MUST bundle a private JRE with your application. Here's how to fix it: In the NBI Engine project locate file org/netbeans/installer/wizard/components/actions/CreateMacOSAppLauncherAction.java. To this file you simply have to add the same code as exist in the equivalent CreateNativeLauncherAction.java file in same directory. So, in CreateMacOSAppLauncherAction.java just before File file = SystemUtils.createLauncher(properties, platform, progress). getOutputFile(); you must add: if (System.getProperty(BUNDLED_JVM_FILE_PROPERTY) != null) { final LauncherResource jvm = new LauncherResource( new File(System.getProperty(BUNDLED_JVM_FILE_PROPERTY))); properties.addJVM(jvm); properties.getJvmArguments().add( "-D" + BUNDLED_JVM_FILE_PROPERTY + "=" + jvm.getAbsolutePath()); } I've done this patch successfully and I'm now able to bundle a private JRE with the NB Installer on Mac OS X.
Created attachment 151735 [details] Proposed patch Patch file attached
Hi, How can we get NBI Engine project to modify "CreateMacOSAppLauncherAction.java"?? I have /netbeans-8.0/harness/modules/ext/nbi-engine.jar, and it contains "CreateMacOSAppLauncherAction.class", and I have "/netbeans-8.0/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/actions" package but it does not contain "CreateMacOSAppLauncherAction.java" Thanks!
@cosette The recipe/workaroubd above assumes that you know how to check out and build a core NB project, in this case "NBI Engine" project. This is not the place for such explanation. It is quite well documented on netbeans.org. I would say, however, that doing so is not for the faint of heart. Hence it is better if NB team could fix this rather than each of us having to do the fix on our own.
I think supporting embedded JRE across all platforms is a necessity as a RCP. That should have always been a goal of the JDK as well. I believe the rise of apps has shown us that. We now have app stores on all the major desktops too. Your normal user does not want to configure an application just so it starts. They also do not care if there is some system component they have to install, and if they do then it is really just a pain and not a feature.
Any particular reason this patch is not being applied? It seems self-contained and there's no obvious way it could break any of the existing uses. Unless vetoed, I will assume silent consent and apply this patch in 10 days.
Patch applied: https://hg.netbeans.org/jet-main/rev/e01ab434ec62 Many thanks to Peter Hansson.
This also seems a good patch candidate.
Integrated into 'main-silver', will be available in build *201705020001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/e01ab434ec62 User: Emilian Bold <emi@netbeans.org> Log: #250103: Support bundled JRE with macOS (thanks to Peter Hansson)