如何解决如何通过 CLI 安装 NetBeans 插件?
问题:
有没有办法通过 CLI 将下载的 NBM(Netbeans 模块)安装到已安装的 Netbeans IDE 中?
当前设置
Netbeans 12.3 与 Windows 10
Netbeans 12.3 和 Linux Mint 20.1
相关场景
如果您想到“为什么不只使用 GUI?”或类似问题。想想下面的场景。在有 50 台计算机的气隙网络上工作时,您必须在所有这些 PC 上安装 Netbeans 插件。您可以将文件放在这些 PC 上并通过控制台执行命令,而您不想绕过所有建筑物并单击整个过程。
非常感谢您。
解决方法
我想我找到了解决办法。我会在这里发布它以反映我的研究,因为我从未在 stackoverflow 上找到答案。
如果已经安装了 Netbeans,您可以使用 --help
参数,例如:C:\Program Files\NetBeans\netbeans\bin\netbeans64.exe --help
这列出了许多可用参数(我在网上没有找到列表),例如(缩短):
General options:
--help show this help
--jdkhome <path> path to JDK
--console new open new console for output
Module reload options:
--reload /path/to/module.jar install or reinstall a module JAR file
Additional module options:
--modules
--refresh Refresh all catalogs
--list Prints the list of all modules,their versions and enablement status
--install <arg1>...<argN> Installs provided JAR files as modules
--disable <arg1>...<argN> Disable modules for specified codebase names
--enable <arg1>...<argN> Enable modules for specified codebase names
--update <arg1>...<argN> Updates all or specified modules
--update-all Updates all modules
Core options:
--fontsize <size> set the base font size of the user interface,in points
--userdir <path> use specified directory to store user settings
--nosplash do not show the splash screen
就我而言,解决方案是使用 --install
参数指向要安装的 jar 文件。
请注意,NBM 文件只是包含 jar 文件和更多元数据文件的容器,例如配置xml文件。例如,您可以通过 7zip 打开它。 并且您必须自己处理所有依赖项。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。