I'm trying to make a .txt file available to my application via the class path. In my startup script--which is co-located in the same folder as the .txt file--I've set the following:
set CLASSPATH=%CLASSPATH%;%CD%\sample.txt java -classpath %CD%\sample.txt
In my application, I've tried the following:
- getClass().getResource("sample.txt")
- getClass().getResource("/sample.txt")
- getClass().getResource("classpath:sample.txt")
None of the above work. Any help would be appreciated.