views:

196

answers:

2

I'm having two nb-projects. One nb-project(a) has the other nb-project(b) as a library dependancy.

Now both nb projects compile/build fine, but the hints for (a) are out of sync.

This interferes when i want to run/debug saying 'one or more projects were compiled with errors'

I've tried

  • opening/closing both projects and recompiling
  • scan for external changes'
  • clean-build, removing the 'compile on save' flags for both projects etc.
  • en/disabling 'Build Jar after compiling' for the jtools project.

Removing the :

./netbeans/6.8/var/index

directory only made things worse for the nb-project(a).. Now exclamation marks for all imports of packages from nb-project(b) But still compile/build worked fine. Even unit-tests within the same netbeans project in(b) didn't even recognize the root-package ?!

After some strugling its a bit better, but hints are still not correct in (a). Now in (a) it says one method doesn't exist in project(b), but i've looked it up in the build-jar of (b).. it's there !?

Any ideas how to get the hints back on track?

Thanks

A: 

I've seen something like this when I upgrade a library but neglect to remove an earlier incompatible version from a path visible to NetBeans. Older JARs carelessly left in an extension directory are particularly troublesome, especially if they alias new entries you've added elsewhere. Also, review the Tools > Libraries dialog entries for duplicates and errors. Finally, check each project to be sure it's using the required libraries.

trashgod
+1  A: 

There are three ways to create dependencies in NB. You can add a project, add a library, or add a jar/folder. Only the "Add Project" button tells NB that the dependency is mutable. The other choices (Library and Jar/Folder) expect the jar will never change.

Try deleting the dependency on project(b), then add it back using the Add Project button.

I only use the Add Library for stable, third-party libraries (apache commons for example). I only use the Add Jar/Folder for third parties libraries I know I won't use anywhere else. Such as vendor libraries for communicating with a particular device.

Devon_C_Miller
+1: seconded - If you are developing two projects concurrently, you should add one project to the other as a `project` rather than s a `library`,. This is how you flag netbeans to listen for changes in the linked project. Otherwise it'll assume its static.
bguiz