Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I need Netbeans help. NO project's -src node appears so no source files--only -Libraries node shows

Tags:

netbeans

I hope it's OK to ask this here. Netbeans forums isn't responding. If not, I'll delete this or ask for it to be deleted. I'm desperate so I'll face the wrath, if any.

I moved my Netbeans projects folder from one directory node to another to make backing up all my stuff easier. BAD MOVE.

Now when I open a project using Files | Open project (ctrl-shift-O) NO source files appear because there is no "+Source Packages" node to expand.

It looks like this for all projects, e.g. one named GBL:

Projects
-GBL
  +Libraries

It doesn't look like this anymore:

Projects
-GBL
  +Source Packages                 (How do I get this back?)
  +Libraries

The Netbeans Properties for each project shows me the path it's using. Windows 7 Explorer shows me that the src, build, and nbproject folders contain files and ALL the source files are in the src folder for that path.

What have I done and more importantly what should I do to get back to being able to open a project normally?

(I've tried recreating the original Netbeans folder and using Windows Explorer to copy an entire project folder into it but: same result--all I see is the Libraries node under the project's name node.)

I just tried to Clean (and also Build) to see what would happen. Error:

ant -f C:\\Users\\Dov\\Documents\\NetBeansProjects\\BasicShirt -Dnb.internal.action.name=build jar

C:\Users\Dov\Documents\NetBeansProjects\BasicShirt\nbproject\build-impl.xml:[u]231[/u]: 

Must set src.dir

I just Set Configuration by right-clicking the project's name and provided a path to the src folder.

NOW I SEE MY SOURCE FILES BUT NOW THIS line in the .xml file is flagged with similar message:

<fail unless="[u][b]test[/b][/u].src.dir">Must set test.src.dir</fail>

NOW what do I do? (Netbeans 7.4.)

If I could get rid of the 7.4 automatic creation of +Test Packages, I might be OK.

If you can help, I'd be very happy.

(I'm considering re-installing 7.3 if available or removing and reinstalling 7.4 and try to avoid the "testing" requirement, but there goes all my many tweaks of 7.4.)

like image 369
DSlomer64 Avatar asked Nov 22 '25 17:11

DSlomer64


1 Answers

Well, after considerable frustration with the problem, I solved it, essentially.

It's here, in total. My synopsis plus how it helped me follows. In short, I had to set up a new java project based on existing sources using the New Project Wiz and simply direct Netbeans to the sources.

  1. File > New Project
  2. Choose Java Project with Existing Sources.
  3. Type a (new) project name and ...
  4. ... make the Project Folder contains the path to where you want the new project to be stored. (For me, this is the folder where Netbeans has been able to find my sources.)
  5. Click Next for the Existing Sources page of the wizard and ... 5a. ... in the Source Packages Folder pane, click Add Folder and ... 5b. ... navigate to your sources and select the source root folder.

Clicking Next goes to the Includes/Excludes pane, which I didn't need to use.

like image 199
DSlomer64 Avatar answered Nov 25 '25 11:11

DSlomer64



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!