微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何通过 CLI 安装 NetBeans 插件?

如何解决如何通过 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 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?