Java doesn't support implicit library inclusion,
IDE or no. You need a class directory structure. Two possible ways are:
1. Denote a "precompiled class" directory, put your resource in that, and add it to the project classpath. This is effectively what you did, but "lib" isn't a good name for such a construct.
2. Add a build function to copy the resource into your compiled classes directory as part of the build process. This is often more trouble than it's worth, so I recommend solution #1.
What I mean by "precompiled class" directory is that unlike your compiled class directory, the precompiled classes (and resources - including images, property files, resource bundles, etc.) are not created as part of the build process, but are externally supplied and static. Since Java (and your IDE) allow multiple class sources, this makes it easy to combine the generated code and the static stuff without having the generate process nuke the static stuff.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.