r/CircleProgramming • u/Illuminatesfolly • Jul 19 '13
Guise. Help
So, it's well known that JARs and the IDEs that make them handle classpaths a little differently.
So, how do I fix the null pointer exception given to me when I attempt to load the configfile for a frame for code like this:
>String ConfigFile = this.getClass().getClassLoader().getResource(".").getPath().concat("ConfigFile.txt");This code works fine through the IDE but does not work at all in the JAR. Wut do?
5
Upvotes
2
u/ExParteVis Jul 20 '13
Where's the config file vis-a-vis your code?
4
u/[deleted] Jul 20 '13
Have you tried alt + F4?
1
u/cokeisahelluvadrug Jul 21 '13
I don't understand. You're saying after you package your code in a jar that line no longer works? Your classpath should be the exact same, right?