Simply put, I need to be able to stick a compiled executable inside a Java jar file and then be able to run it from Java (probably via ProcessBuilder
).
The executable into the jar is a resource, you may access it via a Stream and expand the executable to the TEMP directory, then execute it with ProcessBuilder.
File target = new File( System.getProperty( "java.io.tmpdir" ), <filename> );
InputStream is =
getClass().getClassLoader().getResourceAsStream( <path to rc> );
OutputStream os = new FileOutPutStream( target );
<copy is to os>
Process p = new ProcessBuilder( target ).start();