Java Runtime OR Processbuilder OR Other -
i'd know best alternative running command line executables java. target platforms commands windows 7(+) , unix/linux.
i have class uses runtime.exec() along enhancements javaworld streamgobbler article. works 90% of time on both windows , unix. other 10% of time need extend class , fiddle putting cmd.exe of /bin/sh in front of command. i've had fiddle between using single string has command , arguments splitting command , args string[] array.
my latest new error/exception "java.lang.illegalargumentexception: executable name has embedded quote, split arguments." current runtime.exec() class works fine in eclipse running java application, once build , run command prompt, fails above exception.
so i'm reading should using processbuilder command line executables os platform.
my question is, best alternative? runtime.exec(), processbuilder, or other option? there 1 option service both windows , unix/linux? if not, 1 works best windows? 1 works best unix/linux?
tia, adym
not sure how give bohemian credit, used processbuilder...solution @ :
java - processbuilder command arguments spaces , double-quotes fails
Comments
Post a Comment