问题:
有没有办法通过 CLI 将下载的 NBM(Netbeans 模块)安装到已安装的 Netbeans IDE 中?
当前设置
Netbeans 12.3 与 Windows 10
Netbeans 12.3 与 Linux Mint 20.1
相关场景
如果您想到“为什么不直接使用 GUI?”或类似的问题。想想以下场景。当在拥有 50 台计算机的气隙网络上工作时,您必须在所有这些 PC 上安装 Netbeans 插件。您可以将文件放在这些电脑上并通过控制台执行命令,并且您不想绕着所有建筑物跑来跑去并点击整个过程。
提前非常感谢您。
最佳答案
我想我找到了解决方案。我将其发布在这里以反射(reflect)我的研究,因为我从未在 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
在我的例子中,解决方案是使用指向要安装的 jar 文件的 --install
参数。
请注意,NBM 文件只是包含 jar 文件和一些内容的容器。更多元数据文件,例如配置 xml 文件。例如,您可以通过 7zip 打开它。 并且您必须自己处理所有依赖项。
关于netbeans - 如何通过 CLI 安装 NetBeans 插件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67187392/