Resource file added to Intellij project does not load in produced jar artifact?

I have a project that uses the following code to load a csv file

ClassLoader classLoader = getClass().getClassLoader();
final Reader reader = new InputStreamReader(classLoader.getResourceAsStream(file/accounts.csv));



this code works fine when run from within the Intellij IDE but fails to locate the accounts.csv in the jar file.

I unzipped the application.jar and verified the the files/accounts.csv file was included in the jar.  Think this is a class path issue, but can't figure it out.

Any help would be appreciated.

1 comment
Comment actions Permalink

Figured it out.  Jar files are case sensitive.  OS X  and Windows files are not

code should read

ClassLoader classLoader = getClass().getClassLoader();
final Reader reader = new InputStreamReader(classLoader.getResourceAsStream(File/Accounts.csv));


Thanks for the views

0

Please sign in to leave a comment.