Javaからexeを起動するメモ


// Javaからexeを起動するテスト
import java.lang.Runtime;
import java.lang.Process;

class ExecText{
public static void main( String[] args ){
try{
Runtime runtime = Runtime.getRuntime();
Process process = runtime.exec( "C:\\WINNT\\NOTEPAD.EXE" );
java.io.InputStream input = process.getInputStream();
byte buffer [];
buffer = new byte[8192];
int bytes;
while( ( bytes = input.read( buffer ) ) > 0 )
System.out.write( buffer, 0, bytes );
}
catch( Exception e ){
}
}
}

参考URL
http://sunsite.ualberta.ca/Documentation/Misc/htmldoc-1.8.13/5-cgi.html