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" ), );
InputStream is =
getClass().getClassLoader().getResourceAsStream( );
OutputStream os = new FileOutPutStream( target );
Process p = new ProcessBuilder( target ).start();