Add more existing sources to Java project

前端 未结 4 1562
走了就别回头了
走了就别回头了 2020-12-18 19:51

In Netbeans I can create a project using existing sources of Java files. If I want to add additional sources to a project how can I do so?

相关标签:
4条回答
  • 2020-12-18 20:45
    • right click on project
    • "Properties"
    • "Sources" (top left in the tree)
    • "Source Package Folders:" on the left side of the dialog
    • "Add Folder"
    0 讨论(0)
  • 2020-12-18 20:46

    I had a similar problem where I added files directly to the project path from a file manager and NetBeans did not show them in my project tree.

    I found a good solution for my needs using git. As it is good practice to use a repository for code tracking code changes and I will be doing it regardless. Anyway my resolution to the issue is:

    Check the "Diff to HEAD" on the main project folder from within the NetBeans interface and the new files are now found...While your there double check your changes and commit.

    0 讨论(0)
  • 2020-12-18 20:51

    You can attach a source JAR. You also can use the Import Sources module ("File -> Import Sources") to import source files from the file system.

    0 讨论(0)
  • 2020-12-18 20:53

    NetBeans 8.0 You can copy complete packages including sub-packages to the projects /src/-folder. Then Source » Scan for External Changes and the new sources will be added automatically. Have fun.

    0 讨论(0)
提交回复
热议问题