4

I am trying to create a php application with existing source in NetBeans. So I opened my NetBeans > File > New Project > PHP Application with existing source, After clicking NEXT it went to 'Name and Location' page. after browsing my source folder I get this error

Sources folder is already NetBeans project (maybe only in memory).

I went to my source folder and removed 'nbproject' folder. After that I was able to create project successfully. After that I noticed NetBeans generated new 'nbproject' folder.

Should I replace the new 'nbproject' folder created by NetBeans with my old 'nbproject' folder?

Luthando Ntsekwa
  • 4,192
  • 6
  • 23
  • 52
  • Possible duplicate of ["Sources directory is already netbeans project" error when opening a project from existing sources](https://stackoverflow.com/questions/5089189/sources-directory-is-already-netbeans-project-error-when-opening-a-project-fro) – bummi Jan 05 '19 at 13:04

3 Answers3

3

nbproject folder is for current NetBeans files, as your recent opened files or any other settings. If you had some important changes in settings in your old nbproject, and all the files/paths are the same - you can overwrite new with old one, but i believe that's not the case.

Paweł Tomkiel
  • 1,974
  • 2
  • 21
  • 39
1

You can: in the old nbproject folder, open the private.xml file and deletes the group tag and all its contents. and in private.properties file replaces your current configuration settings. then open the project.xml file replaces your current configuration settings.

rename the new directory generated by NetBeans, and replaces the old directory that you just modified.

this completely worked with me on several occasions

nekiala
  • 450
  • 9
  • 21
1

I had similar problem when I moved source files around, etc. How i handled it was: 1) deleted the folder 'nbproject' from within my project source folder structure. 2) Went into NetBeans and Re-created the same project. Cheers.

JackAction
  • 11
  • 2
  • 1
    You may want to restart Netbeans before re-creating the project, to clear the memory (notice the message: 'maybe only in memory'). – Haitham Sweilem Mar 01 '17 at 05:38