Ok, this one is a little tough for me to explain.
I have a runnable jar file that contains a .exe that I'm trying to exec in my program like a command line function.
Usually to execute a .exe in a command line I would do:
C:\"path to .exe" -option etc etc
This would be the same as doing this in java:
Runtime.getRuntime().exec("'path to .exe' -option etc etc");
What if the .exe was in a jar file and my class was using the above command to execute it?
If I try to use:
final String FILEPATH= "\""+getClass().getResource("file.exe").getPath().split("/",2).replace("%20", " ")+"\"";
If I compile outside of the .jar file, I get the correct path. If I run it using the .jar file, I get something like:
.../File_Name.jar!/file.exe which of course doesnt work..
btw, I know the way I did this was all jacked up. Can anyone help me? I'm sure theres a better way. I can try to explain more if I can.