Gobliins Gobliins - 1 month ago 7
Java Question

Eclipse folders with resources inside Java projects to compile / execution (bin) dir

a little thing which is bothering me for awhile when writing some little java programs to try out some stuff.
I have my project dir in the Eclipse package explorer along with the /src package, along with a /lib and a /resources folder.

Now when i let eclipse run/debug my program and all my relative locations to those dirs are not found since eclipse creats a /bin directory but does not copy my folders.

Can i somehow instruct eclipse to copy my folders into the bin folder?

Answer

You could add the folders you would like to have copied into the bin folder to the source folders.

Right click on your project and choose Properties. Select Java build Path on the left, and click the Source tab.

That should look something like this:

Eclipse JavaBuildPath Source

Click Add Folder... to add your /lib and /resource folders.

Comments