Unable to find .properties file at runtime

How do I edit a Run Configuration in IntelliJ so that the classpath includes a .properties file needed at runtime?

The source is setup as follows:

\oratest.iml
\oratest.ipr
\oratest.iws
\Connection.properties
\src\legoland\oracle\oratest\*.java source files

This is a standard Java app and I have setup and Run Configuration to execute main() in one of the classes. When it runs, one of the java classes do this:

private Connection dbConnection() {
// Load the properties file to get the connection information
Properties prop = loadParams("Connection");
...
}

This method tries to connect to an Oracle database. It fails on the first line with a 'resource bundle not found' exception.

I can't work out how to add '.' to the classpath in the Run Configuration so that it will pick up the Connection.properties on the classpath. Or, I if I move the Connection.properties file to where the java files are, how to have IntelliJ copy the .properties file into the .class output folder so that it finds it at runtime there.

Can anyone help?

Thx

1 comment

Please sign in to leave a comment.