eclipse中对Hadoop项目进行mvn clean install时报错的处理

时间:2023-11-10 17:01:38

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project hadoop_test: Failed to clean project: Failed to delete /home/winstercheng/java/workspace/hadoop_test/target/classes/hadoop_test/WordCount.class -> [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

一开始我以为是jdk版本的问题,然后调整了eclipse中jdk的版本也没解决,最后发现是权限问题。

解决方法:我搭建伪分布式的时候新建了一个Hadoop用户,而平常编程的时候是在原来的用户中进行的,所以mvn指令在原本的用户中执行即可。

PS:建议把环境变量写在/etc/profile里面,这样每个用户都能使用同一个变量,需要详细了解配置文件可以查看http://www.cnblogs.com/WinseterCheng/p/7944534.html。