8 August 2012

how to solve problem with executor-snippets\run.xml:52: is not a valid directory problem in Netbeans?

Story:
Let's say ,that you working on project in various places,so you using different computers .... and you import project you press clean and build and then hit RUN ... and you see following problem...

Error:
run:
C:\Documents and Settings\ufo\Local Settings\Application Data\NetBeans\Cache\7.2\executor-snippets\run.xml:52: C:\virusProjects\MindController is not a valid directory
at org.apache.tools.ant.taskdefs.Java.setupWorkingDir(Java.java:855)
at org.apache.tools.ant.taskdefs.Java.setupExecutable(Java.java:825)
at org.apache.tools.ant.taskdefs.Java.fork(Java.java:788)
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:214)
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor151.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:283)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:541)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
Java Result: -1



SOLUTION:
  1. Simply click on Projects tab,
  2. select your proejct
  3. right click and select Properties
  4. In categories ,select Run
  5. in Working Directory press browse and select path to your project's folder:
  6. press OK
  7. and problem solved.