Eclipse maven工程 Missing artifact com.sun:tools:...

本文详细介绍了如何解决在使用Eclipse时遇到找不到tools.jar文件的问题,通过修改eclipse.ini配置文件,指定正确的JVM路径来解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原来,是${java.home}在作怪,eclipse 没有使用 JAVA_HOME



默认,eclipse 使用 C:"windows"system32"javaw.exe 作为 JVM,当然找不到tools.jar


解决方法如下:



修改 eclipse.exe 目录下的 eclipse.ini 指定vm,,注意 -vm后面不能有空格。

 

 -vm

C:\Program Files\Java\jdk1.6.0_16\bin\javaw.exe

    注意: 要写在两行,写在一行不能生效

    注意: 这两行要定在-vmargs之前,不然也不能生效

-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-XX:PermSize=64M
-XX:MaxPermSize=512M

转载于:https://my.oschina.net/amoshuang/blog/108035

C:\Users\cy\.jdks\openjdk-21.0.1\bin\java.exe -Dmaven.multiModuleProjectDirectory=C:\Users\cy\Desktop\毕业设计\weblog\weblog-springboot -Djansi.passthrough=true -Dmaven.home=C:\Users\cy\work\apache-maven-3.8.5-bin\apache-maven-3.8.5 -Dclassworlds.conf=C:\Users\cy\work\apache-maven-3.8.5-bin\apache-maven-3.8.5\bin\m2.conf "-Dmaven.ext.class.path=C:\Program Files\JetBrains\IntelliJ IDEA 2024.2.3\plugins\maven\lib\maven-event-listener.jar" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2024.2.3\lib\idea_rt.jar=63936:C:\Program Files\JetBrains\IntelliJ IDEA 2024.2.3\bin" -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath C:\Users\cy\work\apache-maven-3.8.5-bin\apache-maven-3.8.5\boot\plexus-classworlds-2.6.0.jar;C:\Users\cy\work\apache-maven-3.8.5-bin\apache-maven-3.8.5\boot\plexus-classworlds.license org.codehaus.classworlds.Launcher -Didea.version=2024.2.3 -s C:\Users\cy\work\apache-maven-3.8.5-bin\apache-maven-3.8.5\conf\settings.xml -Dmaven.repo.local=C:\Users\cy\work\apache-maven-3.8.5-bin\apache-maven-3.8.5\mvn_repo -DskipTests=true package [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Reactor Build Order: [INFO] [INFO] weblog-springboot [pom] [INFO] weblog-module-common [jar] [INFO] weblog-module-jwt [jar] [INFO] weblog-module-admin [jar] [INFO] weblog-web [jar] [INFO] [INFO] ---------------------< com.ccyy:weblog-springboot >--------------------- [INFO] Building weblog-springboot 0.0.1-SNAPSHOT [1/5] [INFO] --------------------------------[ pom ]--------------------------------- [INFO] [INFO] -------------------< com.ccyy:weblog-module-common >-------------------- [INFO] Building weblog-module-common 0.0.1-SNAPSHOT [2/5] [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ weblog-module-common --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Using 'UTF-8' encoding to copy filtered properties files. [INFO] skip non existing resourceDirectory C:\Users\cy\Desktop\毕业设计\weblog\weblog-springboot\weblog-module-common\src\main\resources [INFO] skip non existing resourceDirectory C:\Users\cy\Desktop\毕业设计\weblog\weblog-springboot\weblog-module-common\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ weblog-module-common --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 12 source files to C:\Users\cy\Desktop\毕业设计\weblog\weblog-springboot\weblog-module-common\target\classes [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for weblog-springboot 0.0.1-SNAPSHOT: [INFO] [INFO] weblog-springboot .................................. SUCCESS [ 0.002 s] [INFO] weblog-module-common ............................... FAILURE [ 1.849 s] [INFO] weblog-module-jwt .................................. SKIPPED [INFO] weblog-module-admin ................................ SKIPPED [INFO] weblog-web ......................................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.049 s [INFO] Finished at: 2025-06-24T12:25:21+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project weblog-module-common: Fatal error compiling: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid' -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <args> -rf :weblog-module-common
06-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值