You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

IntelliJ中Codename One插件无法加载问题求助

IntelliJ中Codename One插件无法加载问题求助

各位好,我最近在Windows 11的IntelliJ里用Codename One开发时遇到了个棘手的问题,想请大家帮忙支招:

我已经把Codename One的Git仓库关联好了,IDE安装在C:\eclipse\IntelliJ路径下。但当我打开CN1设置尝试安装BrainTree插件时,直接失败了,插件完全加载不出来。下面是完整的Maven报错日志:

[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.wb.cash:cash-javase:jar:1.0-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.codenameone:codenameone-core:jar -> duplicate declaration of version (?) @ line 60, column 19
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.codenameone:codenameone-javase:jar -> duplicate declaration of version (?) @ line 70, column 19
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] cash [pom]
[INFO] cash-common [jar]
[INFO] cash-javase [jar]
[INFO] 
[INFO] --------------------------< com.wb.cash:cash >--------------------------
[INFO] Building cash 1.0-SNAPSHOT [1/3]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- codenameone-maven-plugin:7.0.196:install-cn1lib (default-cli) @ cash ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for cash 1.0-SNAPSHOT:
[INFO] 
[INFO] cash ............................................... FAILURE [ 0.934 s]
[INFO] cash-common ........................................ SKIPPED
[INFO] cash-javase ........................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.077 s
[INFO] Finished at: 2025-06-22T21:11:07+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.codenameone:codenameone-maven-plugin:7.0.196:install-cn1lib (default-cli) on project cash: Execution default-cli of goal com.codenameone:codenameone-maven-plugin:7.0.196:install-cn1lib failed: Plugin com.codenameone:codenameone-maven-plugin:7.0.196 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:1.8.0 at specified path C:\eclipse\Java_JRE_8/../lib/tools.jar -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.codenameone:codenameone-maven-plugin:7.0.196:install-cn1lib (default-cli) on project cash: Execution default-cli of goal com.codenameone:codenameone-maven-plugin:7.0.196:install-cn1lib failed: Plugin com.codenameone:codenameone-maven-plugin:7.0.196 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:1.8.0 at specified path C:\eclipse\Java_JRE_8/../lib/tools.jar
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
    at java.lang.reflect.Method.invoke (Unknown Source)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (Unknown Source)

我自己初步看了下,日志里有两个明显的问题:

  • 首先是Maven项目里有重复的依赖声明:com.codenameone:codenameone-core和com.codenameone:codenameone-javase都重复声明了版本
  • 核心报错是找不到com.sun:tools:jar:1.8.0,路径指向C:\eclipse\Java_JRE_8/../lib/tools.jar,看起来是JRE路径的问题?

有没有朋友遇到过类似的情况?或者能告诉我该怎么一步步解决这两个问题,顺利装上插件吗?

内容来源于stack exchange

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.08 10:27:57