简体   繁体   English

如何在Netbeans中打开java源代码树?

[英]How to open a java source tree in Netbeans?

There is a directory tree with java sources here and there like src\\com\\company\\foo\\etc. 这里有一个带有java源代码的目录树,比如src \\ com \\ company \\ foo \\ etc。 I am trying to build and debug this luxury with Netbeans. 我正在尝试使用Netbeans构建和调试这种奢侈品。 I tried to create a new project and replace the template files with real ones but I cannot achieve the same directory structure this way. 我试图创建一个新项目并用真实的模板文件替换模板文件,但我无法通过这种方式实现相同的目录结构。 There is option of Eclipse project import but this is not an eclipse project. 可以选择Eclipse项目导入,但这不是eclipse项目。 How can I do it? 我该怎么做?

You can create a new project from existing source code. 您可以从现有源代码创建新项目。 Select "File" --> "New Project" --> "Categories:" --> "Java" --> "Java Project with Existing Sources" then browse for the existing src directory as well as test directory (if one exists). 选择“文件” - >“新建项目” - >“类别:” - >“Java” - >“带有现有源的Java项目”,然后浏览现有的src目录以及测试目录(如果存在) )。

Create new empty java project, and copy contents of your "src" dir to /src in project directory. 创建新的空java项目,并将“src”目录的内容复制到项目目录中的/ src。 If the structure of folders is the same as packages (it should be like this), then everything will be just fine. 如果文件夹的结构与包相同(应该是这样),那么一切都会好的。

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

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