I have a swing project structure in eclipse like the following
MyProject
--src //the java source files
--CustomFolder
-abc.txt
-def.bat
I am accessing abc.txt and def.bat using
File theFile = new File("CustomFolder\abc.txt");
When I run this in eclipse its working fine. But when I export JAR of the project and execute using JAR then it is throwing exception of FileNotFound. I tried using following as well from this link
URL fileUrl = getClass().getClassLoader().getResource("CustomFolder\abc.txt");
but the fileUrl is coming as NULL. So my question is how to provide a file path so that it could be accessed when created a JAR or after creating an exe of the JAR.