java 在 netbeans 中创建/访问库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6205483/
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
Creating/accessing libraries in netbeans
提问by user779891
I am a new netbeans user, and I'm having trouble importing user created libraries.
我是一个新的 netbeans 用户,我在导入用户创建的库时遇到了问题。
I created a library named "MyLibrary". I then added a folder that contains my saved projects (entitled "netbeansProjects") to the classpath, which I wrote in the netbeans IDE. Now I'm trying to import a class into a project I'm working on, but it wont allow to me to it. I'm getting the massage "Package does not exist". I would really appreciate some assistance on this problem. I searched online; I couldn't find anything.
我创建了一个名为“MyLibrary”的库。然后,我将一个包含我保存的项目(名为“netbeansProjects”)的文件夹添加到我在 netbeans IDE 中编写的类路径中。现在我正在尝试将一个类导入我正在处理的项目中,但它不允许我这样做。我收到按摩“包裹不存在”。我真的很感激在这个问题上的一些帮助。我在网上搜索;我找不到任何东西。
回答by Mark
You'll have to create the library using the Netbeans Library Manager. Go to Tools
->Libraries
then select the New Library...
button and make a new Class Library. You will only be able to add jar files using this method not a Netbeans project.
您必须使用 Netbeans 库管理器创建库。转到Tools
->Libraries
然后选择New Library...
按钮并创建一个新的类库。您将只能使用此方法添加 jar 文件,而不是 Netbeans 项目。
To add a Netbeans project:
添加一个 Netbeans 项目:
In the Netbeans Projects window right click on Libraries
folder under your project, and select Add Project...
then navigate to the Netbeans project your would like use.
You will have to do this for each project you would like to use.
在 Netbeans Projects 窗口中,右键单击Libraries
您的项目下的文件夹,然后选择Add Project...
然后导航到您想要使用的 Netbeans 项目。您必须为要使用的每个项目执行此操作。