0

I need to create build file for ant to build my JavaFX project, I have searched a lot, but nothing helped me. It still show errors and does not compiles. When I try to run jar file - the jar file cannot get deleted. Here is part of build.xml which shows error

 <target depends="init" name="-do-clean">
        <delete dir="${build.dir}"/>
        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
    </target>

Here is the error

init:
deps-clean:
Updating property file: D:\javaFx\JavaFXApplication3\build\built-clean.properties
Deleting directory D:\javaFx\JavaFXApplication3\build
D:\javaFx\JavaFXApplication3\nbproject\build-impl.xml:1388: Unable to delete file D:\javaFx\JavaFXApplication3\dist\run1228379781\JavaFXApplication3.jar
BUILD FAILED (total time: 2 seconds)

2 Answers2

0

Usually the problem why something below the dist folder can't be deleted is that your application is still running and you are developing under Windows, just make sure your application did completely shutdown, e.g. check the Task Manager for running java processes and check if you shutdown your application when you hit the X-button, have a look here

Community
  • 1
  • 1
funfried
  • 605
  • 3
  • 14
  • Thank you for your answer but i figured out the problem now the application is working. – akshita gupta Mar 21 '17 at 18:37
  • 1
    You're welcome, maybe you would like to add your own solution as an answer (and accept it), so others when others run into the same issue they get an idea of the solution. – funfried Mar 22 '17 at 07:22
0

Delete the jar file manually,after that try to Clean and Buld again. It is worked for me.