Maven-6:问题:Unable to locate the Javac Compiler in:

Eclisep上构建Maven工程提示:

Unable to locate the Javac Compiler in:
  C:\Program Files\Java\jre6\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
-> [Help 1]

解决办法:

1、确定Eclispse使用的是JDK1.6,不是JRE
2、设置编码格式,发现mvn使用的UTF-8, 而代码使用的GBK
所以将代码格式改成UTF-8

参考:http://stackoverflow.com/questions/3317402/eclipse-maven-plugin-configuration-problem

3、修改Maven编译的默认字符集

参考:http://blog.youkuaiyun.com/jsjszg/article/details/9237189



D:\Software\DevelopmentSoftware\tomcat-green-8.0.52\bin\catalina.bat run [2025-05-31 06:00:52,496] 工件 testhzjcjep2022:war exploded: 正在等待服务器连接以启动工件部署… set JAVA_HOME successfully set CLASSPATH successfully Could not locate D:\Software\DevelopmentSoftware\jdk1.7.0_51\jre\lib\tools.jar. Unexpected results may occur. =============================================================================== JAVA Environment... JAVA: D:\Software\DevelopmentSoftware\jdk1.7.0_51\jre\bin\java JAVA_HOME: D:\Software\DevelopmentSoftware\jdk1.7.0_51\jre CLASSPATH: D:\Software\DevelopmentSoftware\jdk1.7.0_51\jre\lib;D:\Software\DevelopmentSoftware\jdk1.7.0_51\jre\lib\tools.jar =============================================================================== Using CATALINA_BASE: "C:\Users\62403\AppData\Local\JetBrains\IntelliJIdea2023.2\tomcat\04732bd9-e09d-4c2c-b30f-f51153146ebb" Using CATALINA_HOME: "D:\Software\DevelopmentSoftware\tomcat-green-8.0.52" Using CATALINA_TMPDIR: "D:\Software\DevelopmentSoftware\tomcat-green-8.0.52\temp" Using JRE_HOME: "D:\Software\DevelopmentSoftware\jdk1.7.0_51\jre" Using CLASSPATH: "D:\Software\DevelopmentSoftware\tomcat-green-8.0.52\bin\bootstrap.jar;D:\Software\DevelopmentSoftware\tomcat-green-8.0.52\bin\tomcat-juli.jar" 已连接到地址为 ''127.0.0.1:10059',传输: '套接字'' 的目标虚拟机 31-May-2025 18:00:53.356 警告 [main] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxSpareThreads' to '100' did not find a matching property. 31-May-2025 18:00:53.391 警告 [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 'xmlValidation' to 'false' did not find a matching property. 31-May-2025 18:00:53.391 警告 [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 'xmlNamespaceAware' to 'false' did not find a matching property. 31-May-2025 18:00:53.408 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.52 31-May-2025 18:00:53.411 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Apr 28 2018 16:24:29 UTC 31-May-2025 18:00:53.413 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.52.0 31-May-2025 18:00:53.413 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 8 31-May-2025 18:00:53.424 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 6.2 31-May-2025 18:00:53.424 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: x86 31-May-2025 18:00:53.424 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: D:\Software\DevelopmentSoftware\jdk1.7.0_51\jre 31-May-2025 18:00:53.424 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.7.0_51-b13 31-May-2025 18:00:53.424 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation 31-May-2025 18:00:53.424 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\62403\AppData\Local\JetBrains\IntelliJIdea2023.2\tomcat\04732bd9-e09d-4c2c-b30f-f51153146ebb 31-May-2025 18:00:53.424 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: D:\Software\DevelopmentSoftware\tomcat-green-8.0.52 31-May-2025 18:00:53.427 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\62403\AppData\Local\JetBrains\IntelliJIdea2023.2\tomcat\04732bd9-e09d-4c2c-b30f-f51153146ebb\conf\logging.properties 31-May-2025 18:00:53.427 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 31-May-2025 18:00:53.427 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:10059,suspend=y,server=n 31-May-2025 18:00:53.428 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -javaagent:C:\Users\62403\AppData\Local\JetBrains\IntelliJIdea2023.2\captureAgent\debugger-agent.jar 31-May-2025 18:00:53.428 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote= 31-May-2025 18:00:53.428 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=10991 31-May-2025 18:00:53.429 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false 31-May-2025 18:00:53.429 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.password.file=C:\Users\62403\AppData\Local\JetBrains\IntelliJIdea2023.2\tomcat\04732bd9-e09d-4c2c-b30f-f51153146ebb\jmxremote.password 31-May-2025 18:00:53.429 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.access.file=C:\Users\62403\AppData\Local\JetBrains\IntelliJIdea2023.2\tomcat\04732bd9-e09d-4c2c-b30f-f51153146ebb\jmxremote.access 31-May-2025 18:00:53.429 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1 31-May-2025 18:00:53.429 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 31-May-2025 18:00:53.430 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources 31-May-2025 18:00:53.430 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs= 31-May-2025 18:00:53.430 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\62403\AppData\Local\JetBrains\IntelliJIdea2023.2\tomcat\04732bd9-e09d-4c2c-b30f-f51153146ebb 31-May-2025 18:00:53.430 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=D:\Software\DevelopmentSoftware\tomcat-green-8.0.52 31-May-2025 18:00:53.430 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=D:\Software\DevelopmentSoftware\tomcat-green-8.0.52\temp 31-May-2025 18:00:53.430 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Software\DevelopmentSoftware\jdk1.7.0_51\jre\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;D:\Software\DevelopmentSoftware\VMware Workstation\bin\;C:\Program Files\Common Files\Siemens\Automation\Simatic OAM\bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\TortoiseSVN\bin;D:\Software\DevelopmentSoftware\nodejs\;D:\Software\DevelopmentSoftware\Redis\Redis-x64-3.2.100;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;D:\Software\DevelopmentSoftware\mysql8.0.34\bin;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files\Java\jdk1.8.0_152\bin;C:\Program Files\Java\jdk1.8.0_152\jre\bin;D:\Software\DevelopmentSoftware\NetSarang\Xshell 8\;D:\Software\DevelopmentSoftware\NetSarang\Xftp 8\;C:\Program Files\dotnet\;D:\Software\DevelopmentSoftware\微信web开发者工具\dll;F:\Cloud Server\Soft\VisualSVN Server\bin;D:\Software\DevelopmentSoftware\Python\Python312\Scripts\;D:\Software\DevelopmentSoftware\Python\Python312\;C:\Users\62403\AppData\Local\Microsoft\WindowsApps;;D:\Software\DevelopmentSoftware\Microsoft VS Code\bin;C:\Users\62403\AppData\Roaming\npm;. 31-May-2025 18:00:53.540 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8098"] 31-May-2025 18:00:53.562 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 31-May-2025 18:00:53.565 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-5629"] 31-May-2025 18:00:53.567 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 31-May-2025 18:00:53.568 信息 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 445 ms 31-May-2025 18:00:53.602 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina 31-May-2025 18:00:53.602 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.52 31-May-2025 18:00:53.619 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8098"] 31-May-2025 18:00:53.638 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-5629"] 31-May-2025 18:00:53.641 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 73 ms 已连接到服务器 [2025-05-31 06:00:53,856] 工件 testhzjcjep2022:war exploded: 正在部署工件,请稍候… 31-May-2025 18:00:57.937 警告 [RMI TCP Connection(4)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJspConfig Failed to process TLD with path [/WEB-INF/struts-template.tld] and URI [/WEB-INF/struts-template.tld]. The specified path does not exist. 31-May-2025 18:00:58.134 信息 [RMI TCP Connection(4)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. Server start lineuser clear! [2025-05-31 06:01:02,106] 工件 testhzjcjep2022:war exploded: 工件已成功部署 [2025-05-31 06:01:02,106] 工件 testhzjcjep2022:war exploded: 部署已花费 8,250 毫秒 31-May-2025 18:01:03.623 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory D:\Software\DevelopmentSoftware\tomcat-green-8.0.52\webapps\manager 31-May-2025 18:01:03.666 信息 [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 31-May-2025 18:01:03.672 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory D:\Software\DevelopmentSoftware\tomcat-green-8.0.52\webapps\manager has finished in 49 ms
06-01
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值