You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Lars Bruun-Hansen (Jira)" <ji...@apache.org> on 2021/11/23 16:47:00 UTC

[jira] [Updated] (NETBEANS-6228) NBI: Support JVM bundling with other than Info-Zip

     [ https://issues.apache.org/jira/browse/NETBEANS-6228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Bruun-Hansen updated NETBEANS-6228:
----------------------------------------
    Description: 
(This ticket is carried over from [BugZilla #239238|https://bz.apache.org/netbeans/show_bug.cgi?id=239238].)

The NBI has a feature whereby a JRE can be bundled as a self-executable compressed archive. This means the Installer can be launched without any JRE present on the target machine: the JRE is simply bundled inside the Installer executable.

In order to execute the archive (uncompress it), NBI will add a {{-d}} option to the command line. Unfortunately this option is very specific to Info-ZIP's version of self-executables. This excludes use of other archive methods, for example 7Zip, which does not recognize a {{-d}} option.

For one reason or another 7Zip compresses a JRE far better than Info-ZIP. It is also better documented. In contrast the Info-ZIP project seems rather abandoned and it is not trivial to get hold of the 'unzipsfx' stub needed to create the self-executable.

What to do about it: The {{-d}} option to Info-Zip's unzipsfx specifies a target directory to unzip into. Instead of using this option the same effect can be achieved by first changing the working directory into the target directory (creating it if it doesn't exist) and then executing the self-executable archive which will then uncompress into the current directory. Hence the suggestion is to avoid any command line arguments on the self-executable archive.

This way the user of the NetBeans Platform is free to use his/her own choice of archiving mechanism as long the archiving mechanism can produce a self-executable archive.
 
The problem only exists on Windows. On other platforms the Installer Launcher does not add the {{-d}} option. The problem is in [JavaUtils.c file|https://github.com/apache/netbeans/blob/master/nbi/engine/native/launcher/windows/src/JavaUtils.c], line 626-627. These lines are unnecessary as in line 629 the command is anyway executed with {{jvmDir}} as the working directory. Therefore a fix is trivial and will have no side-effects.

  was:
(This ticket is carried over from [BugZilla #239238|https://bz.apache.org/netbeans/show_bug.cgi?id=239238].)

The NBI has a feature whereby a JRE can be bundled as a self-executable compressed archive. This means the Installer can be launched without any JRE present on the target machine: the JRE is simply bundled inside the Installer executable.

In order to execute the archive (uncompress it), NBI will add a {{-d}} option to the command line. Unfortunately this option is very specific to Info-ZIP's version of self-executables. This excludes use of other archive methods, for example 7Zip. which does not recognize a {{-d}} option.

For one reason or another 7Zip compresses a JRE far better than Info-ZIP. It is also better documented. In contrast the Info-ZIP project seems rather abandoned and it is not trivial to get hold of the 'unzipsfx' stub needed to create the self-executable.

What to do about it: The {{-d}} option to Info-Zip's unzipsfx specifies a target directory to unzip into. Instead of using this option the same effect can be achieved by first changing the working directory into the target directory (creating it if it doesn't exist) and then executing the self-executable archive which will then uncompress into the current directory. Hence the suggestion is to avoid any command line arguments on the self-executable archive.

This way the user of the NetBeans Platform is free to use his/her own choice of archiving mechanism as long the archiving mechanism can produce a self-executable archive.
 
The problem only exists on Windows. On other platforms the Installer Launcher does not add the {{-d}} option. The problem is in [JavaUtils.c file|https://github.com/apache/netbeans/blob/master/nbi/engine/native/launcher/windows/src/JavaUtils.c], line 626-627. These lines are unnecessary as in line 629 the command is anyway executed with {{jvmDir}} as the working directory. Therefore a fix is trivial and will have no side-effects.


> NBI:  Support JVM bundling with other than Info-Zip
> ---------------------------------------------------
>
>                 Key: NETBEANS-6228
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-6228
>             Project: NetBeans
>          Issue Type: Improvement
>          Components: platform - installer
>            Reporter: Lars Bruun-Hansen
>            Priority: Trivial
>
> (This ticket is carried over from [BugZilla #239238|https://bz.apache.org/netbeans/show_bug.cgi?id=239238].)
> The NBI has a feature whereby a JRE can be bundled as a self-executable compressed archive. This means the Installer can be launched without any JRE present on the target machine: the JRE is simply bundled inside the Installer executable.
> In order to execute the archive (uncompress it), NBI will add a {{-d}} option to the command line. Unfortunately this option is very specific to Info-ZIP's version of self-executables. This excludes use of other archive methods, for example 7Zip, which does not recognize a {{-d}} option.
> For one reason or another 7Zip compresses a JRE far better than Info-ZIP. It is also better documented. In contrast the Info-ZIP project seems rather abandoned and it is not trivial to get hold of the 'unzipsfx' stub needed to create the self-executable.
> What to do about it: The {{-d}} option to Info-Zip's unzipsfx specifies a target directory to unzip into. Instead of using this option the same effect can be achieved by first changing the working directory into the target directory (creating it if it doesn't exist) and then executing the self-executable archive which will then uncompress into the current directory. Hence the suggestion is to avoid any command line arguments on the self-executable archive.
> This way the user of the NetBeans Platform is free to use his/her own choice of archiving mechanism as long the archiving mechanism can produce a self-executable archive.
>  
> The problem only exists on Windows. On other platforms the Installer Launcher does not add the {{-d}} option. The problem is in [JavaUtils.c file|https://github.com/apache/netbeans/blob/master/nbi/engine/native/launcher/windows/src/JavaUtils.c], line 626-627. These lines are unnecessary as in line 629 the command is anyway executed with {{jvmDir}} as the working directory. Therefore a fix is trivial and will have no side-effects.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists