简体   繁体   English

Netbeans和源文件夹

[英]Netbeans and source folders

I am working on a large project and I have configured multiple source package folders. 我正在处理一个大型项目,并且已经配置了多个源包文件夹。

Project -> Properties -> Sources

However, when I import a library from this other source folder it says it doesn't exist so obviously with source folder is only liked in during compile time. 但是,当我从另一个源文件夹导入库时,它说该库不存在,因此显然只有在编译时才喜欢源文件夹。

How do I get my project to reference these source files to work within my project without creating class files etc, and keeping both source directories separate from one another? 如何使我的项目引用这些源文件以在我的项目中工作而不创建类文件等,并使两个源目录彼此分开?

Thanks 谢谢

If I understand your question correctly, you wish to make the source files from one NetBeans (Java Application) project A visible in another like project B . 如果我正确理解了您的问题,则希望使一个NetBeans(Java应用程序)项目A的源文件在另一个项目B中可见。

In project B : 在项目B中

  1. Go to Properties >> Libraries 转到属性>>库
  2. Go to the Libraries category 转到库类别
  3. Go to the Compile tab 转到编译选项卡
  4. Choose 'Add Project...' and select project A . 选择“添加项目...”,然后选择项目A。

Regardless of whether the sources in A have been compiled, you should then be able to use them (eg, name auto-complete, javadoc peek) when editing source code in B . 无论A中的源代码是否已编译,在B中编辑源代码时,您都应该能够使用它们(例如,名称auto-complete,javadoc peek)。

确保正确定义了软件包名称!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM