Java 未设置 libs.CopyLibs.classpath 属性
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23532966/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The libs.CopyLibs.classpath property is not set up
提问by user3588496
I'm using Eclipse Indigo (3.7) to build an application using ant
and a build.xml
file.
我使用Eclipse靛蓝(3.7)来构建使用应用程序ant
和build.xml
文件。
I am getting the following exception:
我收到以下异常:
C:\navigator\nbproject\build-impl.xml:774: The libs.CopyLibs.classpath property is not set up.
This property must point to
org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part
of NetBeans IDE installation and is usually located at
<netbeans_installation>/java<version>/ant/extra folder.
Either open the project in the IDE and make sure CopyLibs library
exists or setup the property manually. For example like this:
ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar
Can anyone suggest me how to resolve this issue?
谁能建议我如何解决这个问题?
回答by BigFish
I know the OP was asking about Eclipse, but I've run into this problem a few times using NetBeans, and the standard answer to set libs.CopyLibs.classpath property in Tools, Options, Java Properties never worked for me. Neither has the answer that includes commenting out lines in nbproject/private/private.properties, etc.
我知道 OP 正在询问 Eclipse,但我使用 NetBeans 遇到过几次这个问题,在工具、选项、Java 属性中设置 libs.CopyLibs.classpath 属性的标准答案对我来说从来没有用过。也没有包括注释 nbproject/private/private.properties 等中的行的答案。
I did find that in the Project Properties dialog, under Libraries you can create a Libraries Folder and everything you specify, including the CopyLibs jar will go in there. I've done this to include all resources needed by a WAR file so the WAR wasn't dependent on server files and it worked for me.
我确实发现在 Project Properties 对话框中,在 Libraries 下,您可以创建一个 Libraries 文件夹,并且您指定的所有内容,包括 CopyLibs jar 都将放入其中。我这样做是为了包含 WAR 文件所需的所有资源,因此 WAR 不依赖于服务器文件,它对我有用。
Hope this helps someone looking for a NetBeans answer (maybe there is something similar in Eclipse).
希望这可以帮助寻找 NetBeans 答案的人(也许 Eclipse 中有类似的东西)。
回答by Thilina Premasiri
I had the same problem after pulling a NetBeans project from GitHub. The problem was, the file /nbproject/private.properties
contained a line...
从 GitHub 中提取 NetBeans 项目后,我遇到了同样的问题。问题是,该文件/nbproject/private.properties
包含一行...
"user.properties.file=C:\Users\Thilina\AppData\Roaming\NetBeans\7.3\build.properties"
...which was pointing to a wrong location. I corrected that and the problem went away.
...指向错误的位置。我纠正了这个问题,问题就消失了。
回答by BustedSanta
This following worked for me:
以下对我有用:
1) Downloaded and added the org-netbeans-modules-java-j2seproject-copylibstask.jarto my Ant/lib directory: C:/apache-ant-1.9.4/lib/
1) 下载并添加org-netbeans-modules-java-j2seproject-copylibstask.jar到我的 Ant/lib 目录:C:/apache-ant-1.9.4/lib/
2) (in command line) Navigated to the folder containing my "build.xml" file:
2)(在命令行中)导航到包含我的“build.xml”文件的文件夹:
cd C:\eclipse_workspace\myproject\abcfolder
cd C:\eclipse_workspace\myproject\abcfolder
(my build.xml location: C:\eclipse_workspace\myproject\abcfolder\build.xml)
(我的 build.xml 位置:C:\eclipse_workspace\myproject\abcfolder\build.xml)
3) Ran the following commmand:
3)运行以下命令:
ant -Dlibs.CopyLibs.classpath=C:/apache-ant-1.9.4/lib/org-netbeans-modules-java-j2seproject-copylibstask.jar
ant -Dlibs.CopyLibs.classpath=C:/apache-ant-1.9.4/lib/org-netbeans-modules-java-j2seproject-copylibstask.jar
I got a successful build.
我得到了一个成功的构建。
回答by TomDK
I just stumbed across this article which helped me: http://www.adam-bien.com/roller/abien/entry/how_to_fix_the_libs
我偶然发现了这篇对我有帮助的文章:http: //www.adam-bien.com/roller/abien/entry/how_to_fix_the_libs
Instructions for Netbeans 8
Netbeans 8 说明
Open: Tools->Options->Java->Ant Paste the following in Properties:
打开:工具->选项->Java->Ant 在属性中粘贴以下内容:
libs.CopyLibs.classpath=[Netbeans Install]NetBeans6.5java2antextraorg-netbeans-modules-java-j2seproject-copylibstask.jar
回答by ashish patel
Please find below for the Solution:Below is an error that I was facing while building the project:
请在下面找到解决方案:以下是我在构建项目时遇到的错误:
"The libs.CopyLibs.classpath property is not set up. This property must point to org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part of NetBeans IDE installation and is usually located at /java/ant/extra folder. Either open the project in the IDE and make sure CopyLibs library exists or setup the property manually. For example like this: ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar"
“未设置 libs.CopyLibs.classpath 属性。此属性必须指向 org-netbeans-modules-java-j2seproject-copylibstask.jar 文件,该文件是 NetBeans IDE 安装的一部分,通常位于 /java/ant/extra文件夹。要么在 IDE 中打开项目并确保 CopyLibs 库存在或手动设置属性。例如:ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject- copylibstask.jar"
Here is a solution:
这是一个解决方案:
--> Open Netbeans
--> 打开 Netbeans
--> Select Project
--> 选择项目
--> Right Click
--> 右键单击
--> Property
--> 属性
--> Libraries
--> 图书馆
Now change the path of the library where your javaee-endorsed-api-7.0is stored. In file browser
现在更改存储javaee-endorsed-api-7.0的库的路径。在文件浏览器中
--> Select your project
--> 选择你的项目
--> Select lib folder
--> 选择lib文件夹
--> Click Open Button
--> 点击打开按钮
You will ables to see it will be like: lib\nblibraries.properties
您将能够看到它类似于:lib\nblibraries.properties
Now your problem is resolved. Do not need to download the file beacuse it comes with Netbeans Package. You just have to find the file.
现在你的问题解决了。不需要下载文件,因为它带有 Netbeans 包。你只需要找到文件。