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:
None of the above work. Any help would be appreciated.
You must pack you txt file inside jar or place it in directory included in classpath.
You should add to your classpath the directory containing the file, and not the file itself:
set CLASSPATH=%CLASSPATH%;%CD%
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With