I am making a small tool in Eclipse which needs to run a C executable - the file is in one of the packages and runs fine inside the IDE.
When I try to package it as a .jar though, nothing seems to work - InvocationTargetException
, NullPointerException
, they've all showed up while trying to fix it, and I'm pretty sure the .jar doesn't work because files can't be accessed inside it without using getResourceAsStream()
. I've tried using getResource()
but it just returns variations of where the file should be - but it can't be accessed as it's in a jar.
Many questions here of the same nature are answered by using getResourceAsStream()
, but I'm not sure that works for an executable. Is there a way to access a file inside a .jar other than the resource stream method? Or am I just thinking of this the wrong way, and there's a simple solution I'm missing?