tomcat启动窗口报错&&eclipse使用maven编译时报错

时间:2021-10-17 15:57:57

tomcat启动窗口报错
log4j:ERROR Could not find value for key log4j.appender.stdout
log4j:ERROR Could not instantiate appender named "stdout".
解决办法:
原来是log4j.properties少了一行应该是:
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
如果是控制台:named "console"
需要在log4j.properties增加
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout


eclipse使用maven编译时报错
-Dmaven.multiModuleProjectDirectory system property is not set. Check $M2_HOME environment variable and mvn script match.
解决办法:
先在系统中设置环境变量M2_HOME指向你的maven安装目录,
再在VM Options中设置
Preference->Java->Installed JREs->Edit 选择一个jdk, 添加 -Dmaven.multiModuleProjectDirectory=$M2_HOME