Your classpath is defined when you run your app using the java
command. You can specify it using:
java -cp $path my.Main
where $path is your classpath. It is a :
-separated (;
on windows) list of JAR files and/or directories containing compiled .class
files.
If you run your program like:
java -cp configdir my.Main
And put your spring config in configdir (the fully-qualified path) then that should be discovered.
NetBeans: whilst I'm not a netbeans user, it probably offers a number of ways for you to complete the task you want:
In your run configuration (i.e. where you define what class is being run, what the command-line parameters are etc), you will probably be able to add items to the classpath. These might be directories or individual files
In your compiler settings, you can probably tell NetBeans to automatically copy files of a certain type (like properties files, XML config files) from your source locations to where NetBeans puts your class files.
If you put your config.xml
file in the directory where NetBeans is compiling your .class files to