How to create a java progam to compile and run a list of java programs -


instead of using .bat file, how code can built java program compiling , executing list of java programs.

on runtime.exec

though perhaps not ideal solution, execute shell command separate process using runtime.getruntime().exec(somecommand). there overloads takes parameters string[].

this not easy solution. managing concurrent process , preventing deadlock etc not trivial.

related questions


on draining process streams

generally can't waitfor() process terminate; must drain i/o streams prevent deadlock.

from the api:

because native platforms provide limited buffer size standard input , output streams, failure promptly write input stream or read output stream of subprocess may cause subprocess block, , deadlock.

related questions


on java 6 compiler api

one option compiling java source code within java use java 6 compiler api. requires jdk installed (not jre).

see also

related questions


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -