首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >由于java.io.FileNotFoundException /usr/share/ant/lib/ecj.jar (权限被拒绝),无法将/home/[...]/ecj.jar复制到/usr/share/ant/lib/ecj.jar

由于java.io.FileNotFoundException /usr/share/ant/lib/ecj.jar (权限被拒绝),无法将/home/[...]/ecj.jar复制到/usr/share/ant/lib/ecj.jar
EN

Stack Overflow用户
提问于 2016-02-08 11:12:25
回答 2查看 1.4K关注 0票数 0

虽然ant clean在Liferay IDE中运行良好,但从命令行尝试时,我得到:

代码语言:javascript
复制
$ ant clean
Buildfile: /home/nico/myportlet/build.xml
     [copy] Copying 1 file to /usr/share/ant/lib
Attempt to copy /home/nico/liferay-plugins-sdk-6.2-ee-sp14/lib/ecj.jar to /usr/share/ant/lib/ecj.jar using NIO Channels failed due to '/usr/share/ant/lib/ecj.jar (Permission denied)'.  Falling back to streams.

BUILD FAILED
/home/nico/myportlet/build.xml:5: The following error occurred while executing this line:
/home/nico/liferay-plugins-sdk-6.2-ee-sp14/portlets/build-common-portlet.xml:5: The following error occurred while executing this line:
/home/nico/liferay-plugins-sdk-6.2-ee-sp14/build-common-plugin.xml:5: The following error occurred while executing this line:
/home/nico/liferay-plugins-sdk-6.2-ee-sp14/build-common.xml:94: Failed to copy /home/nico/liferay-plugins-sdk-6.2-ee-sp14/lib/ecj.jar to /usr/share/ant/lib/ecj.jar due to java.io.FileNotFoundException /usr/share/ant/lib/ecj.jar (Permission denied)

Total time: 2 seconds

如何解决这个问题?

EN

回答 2

Stack Overflow用户

发布于 2016-02-08 11:12:25

只需以root用户身份手动复制文件即可。

这样做之后,ant将会很高兴,并且可以毫无抱怨地执行任务。

以下是如何在Linux/Mac上执行此操作:

代码语言:javascript
复制
sudo cp /home/nico/liferay-plugins-sdk-6.2-ee-sp14/lib/ecj.jar /usr/share/ant/lib/
票数 2
EN

Stack Overflow用户

发布于 2017-08-14 14:44:47

或者为了不弄乱系统库,我们可以像这样引用文件夹到ant:

代码语言:javascript
复制
ant clean -lib /home/nico/liferay-plugins-sdk-6.2-ee-sp14/lib
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35261846

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档