Clearn and Build weird quirk (not always working)

For some weird reason the “Clean and Build” dies on me once in a while with this error:

Deleting directory H:\Users\Dany\Documents\jMonkeyProjects\jME3\engine\build H:\Users\Dany\Documents\jMonkeyProjects\Disenthral\nbproject\build-impl.xml:1406: The following error occurred while executing this line: H:\Users\Dany\Documents\jMonkeyProjects\Disenthral\nbproject\build-impl.xml:1442: The following error occurred while executing this line: H:\Users\Dany\Documents\jMonkeyProjects\jME3\engine\nbproject\build-impl.xml:1598: Unable to delete file H:\Users\Dany\Documents\jMonkeyProjects\jME3\engine\dist\jMonkeyEngine3.jar BUILD FAILED (total time: 4 seconds)

When it happens I wait for 3-5 seconds and hit the button again. It goes through w/o a problem.

This is on a new install of the 3.0 stable. Since there isn’t any opened issue about this I imagine there must be something “wrong” with my project’s properties, but unsure why or what. AFAIK I wasn’t getting that before going on my writing spree.

Someone has a suggestion where I could look for to fix this? It’s not a huge problem, but I prefer it when stuff works on the first click. :wink:

Windows puts locks on files when they are opened by any application since win 7. Maybe another application is running that somehow accesses the files?

Very doubtful. If there is something locking the file it’s Java. I don’t have anything actively opened either in the directory or in a program.

I’ve got an app that can tell me what process is locking a file, if any. I’ll try this when it happens. Hopefully I can catch the process before it releases it. :confused:

It could be some stupid index stuff of windows.

Indexing is turned off.

Besides, even if it were on, it would index the file after it was modified, not before. At the minimum it would not index at the first ‘clean and rebuild’ of the day. Anyway, indexing isn’t intrusive. If that were the case there would be a whole lot more reports of that.

Was a nice try though.

The only lock I could get was the one the SDK was doing.

Just rechecked and the lock is gone.

Trying a rebuild…

And it goes without a hitch.

I get this when I have one project depend on another (which is what it looks like you are doing). Regular jar dependencies don’t do it generally.

It’s because when I clean build the main project it is also clean building the dependent project and sometimes this seems to get confused with the process that is checking for external changes. Generally, a second clean-build will run without a hitch. For Mythruna, I’m a few project dependencies deep by now so sometimes it takes three clean-builds to succeed.

I agree Paul.

I don’t see how else this could happen honestly. Since I’m depending on 2 projects it sometimes happen I have to do it twice, but so far I can’t say it happens all the time.

It’s also not a big thing, but if it were fixed it would just add to the overall experience.

I used to do clean builds regularly but this is one of the reasons that I stopped. I turned off “Compile on Save” for all of my projects since that sometimes causes other weird errors at runtime (that look like compile errors)… and after that I mostly just let the project build itself when I run or I run a regular non-clean build.

Not a solution but a work-around… and it is faster than a clean build. I save those for when I’m in “weird land” after some refactoring or I’m making/testing real releases.

Ok. I’m not crazy then! :smiley:

Well… That’s still debatable, but at least that behavior I’ve seen is pretty much on par with what you’ve experienced. But for the life of me, why no one else has reported it?! :expressionless:

@madjack said: Ok. I'm not crazy then! :D

Well… That’s still debatable, but at least that behavior I’ve seen is pretty much on par with what you’ve experienced. But for the life of me, why no one else has reported it?! :expressionless:

I suspect most aren’t doing project to project dependencies.

I’ve been seeing this issue off and on for quite a while - again in projects that depend on each other.

I don’t do a full clean and build very often so when I do having to repeat it a few times isn’t a big deal so I never bothered reporting it. TBH I assumed it was either a netbeans issue or something obscure in the way netbeans and the SDK are interacting so the amount of time that would be needed to fix it just wasn’t proportional to the minor annoyance.