【问题标题】:Netbeans 12.5 can't install Java ME pluginNetbeans 12.5 无法安装 Java ME 插件
【发布时间】:2021-12-29 04:33:33
【问题描述】:

以下是我正在使用的,

  • 操作系统:macOS Big Sur
  • NetBeans:12.5
  • 爪哇:7 / 8 / 17

我正在尝试安装 Java Me 插件

安装后,我一直收到这个

我尝试过使用 java 7、8 和 17(我正在使用 jenv 来控制 java 版本)。没有任何效果。有人可以帮忙吗?

编辑: 以下是我尝试安装时得到的日志(使用jdk17,我还检查了防火墙是否关闭)

java.io.FileNotFoundException: /Applications/NetBeans/Apache NetBeans 12.5.app/Contents/Resources/NetBeans/netbeans/mobility/modules/locale/org-netbeans-modules-mobility-jsr172_ja.jar (No such file or directory)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(FileInputStream.java:216)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
    at org.netbeans.updater.UpdateTracking.getFileCRC(UpdateTracking.java:507)
[catch] at org.netbeans.updater.ModuleUpdater.unpack(ModuleUpdater.java:469)
    at org.netbeans.updater.ModuleUpdater.run(ModuleUpdater.java:117)
INFO [org.netbeans.updater]: File /Applications/NetBeans/Apache NetBeans 12.5.app/Contents/Resources/NetBeans/netbeans/mobility/update/download/org-netbeans-modules-mobility-jsr172.nbm deleted.
INFO [org.netbeans.updater]: Use XML Transformer: com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl@afcc1b6
INFO [org.netbeans.updater]: File /Applications/NetBeans/Apache NetBeans 12.5.app/Contents/Resources/NetBeans/netbeans/mobility/update_tracking/org-netbeans-modules-mobility-jsr172.xml modified.
INFO [org.netbeans.updater]: File installed /Applications/NetBeans/Apache NetBeans 12.5.app/Contents/Resources/NetBeans/netbeans/mobility/update_tracking/org-netbeans-modules-mobility-jsr172.xml@1,637,575,673,151
INFO [org.netbeans.updater]: File /Users/awesomeee/Library/Application Support/NetBeans/12.5/config/Modules/org-netbeans-modules-mobility-jsr172.xml_hidden deleted.
INFO [org.netbeans.updater]: File /Applications/NetBeans/Apache NetBeans 12.5.app/Contents/Resources/NetBeans/netbeans/mobility/update/download/additional_information.xml deleted.
INFO [org.netbeans.core.startup.NbEvents]: Warning: the module /modules/org-netbeans-modules-mobility-licensing.jar could not be found, ignoring...
INFO [org.netbeans.core.startup.NbEvents]: Warning: the module /modules/org-netbeans-modules-j2me-common-ant.jar could not be found, ignoring...
INFO [org.netbeans.core.startup.NbEvents]: Warning: the module /modules/org-netbeans-api-mobility.jar could not be found, ignoring...
INFO [org.netbeans.core.startup.NbEvents]: Warning: the module /modules/org-netbeans-modules-mobility-jsr172.jar could not be found, ignoring...
INFO [org.netbeans.core.startup.NbEvents]: Warning: the module /modules/org-netbeans-modules-mobility-end2end.jar could not be found, ignoring...
INFO [org.netbeans.core.startup.NbEvents]: Warning: the module /modules/org-netbeans-modules-j2me-kit.jar could not be found, ignoring...
INFO [org.netbeans.core.startup.NbEvents]: Warning: the module /modules/org-netbeans-modules-j2me-project.jar could not be found, ignoring...
INFO [org.netbeans.core.startup.NbEvents]: Warning: the module /modules/org-netbeans-modules-mobility-databindingme.jar could not be found, ignoring...
INFO [org.netbeans.core.startup.NbEvents]: Warning: the module /modules/org-netbeans-modules-mobility-cldcplatform.jar could not be found, ignoring...
INFO [org.netbeans.modules.autoupdate.services.InstallSupportImpl]: Timeout waiting for loading module org.netbeans.modules.mobility.jsr172@1.31.1
INFO [org.netbeans.modules.autoupdate.ui.wizards.InstallStep]: timeout of loading Java ME Web Service Clients (JSR 172)[org.netbeans.modules.mobility.jsr172/1.31.1]
org.netbeans.api.autoupdate.OperationException[INSTALL]: timeout of loading Java ME Web Service Clients (JSR 172)[org.netbeans.modules.mobility.jsr172/1.31.1]
    at org.netbeans.modules.autoupdate.services.InstallSupportImpl$3.call(InstallSupportImpl.java:431)
    at org.netbeans.modules.autoupdate.services.InstallSupportImpl$3.call(InstallSupportImpl.java:291)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[catch] at java.base/java.lang.Thread.run(Thread.java:833)

【问题讨论】:

  • 查看Installing J2ME plugins in NetBeans 12.4 接受的答案。尽管该答案是为 NetBeans 12.4 编写的,并且问题中的问题与您的不同,但我刚刚验证了接受的答案对于 NetBeans 12.5 仍然有效。因此,我投票决定将您的问题作为重复项结束,但如果该解决方案对您不起作用,那么:[1] 更新您的问题以详细说明该解决方案为何不适合您。 [2] 问题更新后回复此评论,我将在此处发布特定于 12.5 的答案。
  • 这能回答你的问题吗? Installing J2ME plugins in NetBeans 12.4
  • 另外,请更新您的问题以指定用于下载 ME 插件的 URL。刚刚为我工作的是http://updates.netbeans.org/netbeans/updates/8.2/uc/final/distribution/catalog.xml.gz
  • 不幸的是,这是我关注的帖子,但我仍然无法安装 Java Me..
  • [1] 好的。由于两天前它对我有用,而且看起来你做的一切都是正确的,我想知道是否存在暂时的网络问题,或者你身边是否存在环境问题,例如防火墙。也许只是再试一次看看它是否有效?如果未在超时后使用 NetBeans 日志(查看 > IDE 日志)中的任何相关消息更新您的问题。 [2] 完全不知道您为什么要使用 Java 7,但我认为 NetBeans 自 8.2 版起就不再支持它。 [3] 仅供参考,我使用 JDK 17 作为默认平台运行 NetBeans 12.5,但 JDK 8 应该也能正常工作。

标签: java netbeans java-me netbeans-12


【解决方案1】:

OP 的错误消息“The plugin install found problem timeout of loading Java ME Web Service Clients”具有误导性,因为它表明可能存在网络问题。但是,NetBeans 日志文件中的FileNotFoundException 显示,真正的原因是插件安装程序失败,因为它找不到文件 unpack200.exe 来解压下载的插件。

如果 NetBeans 在 JDK 14 或更高版本上运行,则会出现此问题,因为在该版本中删除了 unpack200.exe。详情请见JEP 367: Remove the Pack200 Tools and API

过去的解决方法是使用包含 unpack200.exe 的早期 JDK 临时运行 NetBeans,通常是 JDK 8 或 JDK 11。然后,一旦成功安装插件,只需恢复使用你的 JDK >= 14.That approach is documented in great detail here。该答案中的大多数单独步骤仍然有效,但不再需要恢复为在 JDK

当在 JDK >= 14 上运行 NetBeans 12.5 时,插件安装程序现在会在下载插件后检测到 unpack200.exe 丢失,并邀请您提供它的实例:

点击屏幕左下方的Choose Unpack200...按钮打开以下对话框:

导航到您计算机上的任何 unpack200.exe 实例。它将驻留在任何 JDK 版本 bin 目录中。一旦插件安装程序找到 unpack200.exe 的实例,它就可以将下载的插件转换为 jar 文件完成插件安装过程。

注意事项:

  • 虽然这个问题是关于 Java ME 插件的,但同样 当在 JDK >= 14 上运行 NetBeans 并安装任何使用 Pack200/Unpack200 API 的插件时,该方法适用。

  • NetBeans 要求 unpack200.exe 的位置只发生一次。此后,它默认使用您最初提供的位置。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多