This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I recommend you don't use backslashes in filenames in Java and java-based systems such as Ant. Backslashes are not only OS-specific, they're also often interpreted as escape characters, leading to unexpected results. You can do this instead:
Or, better still:
Also, it's not a good idea to embed your output directory inside your source directory. Make a separate source directory in its own separater subtree. It makes it harder to accidentally delete all your source code and you don't run into unpleasant surprises from tools such as Eclipse that automatically clean output directories.
Also, it looks lie you're keeping the Ant build.xml separate from your actual project. It's a good idea to keep the Ant build file inside your project directory (I keep it in the project root). That way if you want to transport your project to another machine - or use a source code management system - everything's in one place.
An IDE is no substitute for an Intelligent Developer.
This is the latest build file ....i have removed the target='all' But still i am getting the same error I am giving the build through Eclipse by setting up the Ant build for my project and rt clicking on the project and say build.
If you leave the default target empty, it's not going to do anything, unless you explicitly tell which target you want to execute. I have tried to copy/paste your build.xml, and to execute under Eclipse. Nothing happens, but the build is successful :
Then I have tried to explicitly set the target called "compile" to be executed. It is also successful :
The "bin" directory has been created.
I am giving the build through Eclipse by setting up the Ant build for my project
Do you mean : Right click on your project -> Properties -> Builder -> Ant builder ? If so, please tell us more about your settings in it. [ September 04, 2007: Message edited by: Christophe Verre ]
Sorry, I'm puzzled. The error is "Target `bin' does not exist in this project. ", which means that you are trying to execute a target called "bin", which obviously does not exist. It might be something in your project setting. Did you check "Properties -> Builder" on your project ? [ September 04, 2007: Message edited by: Christophe Verre ]