Run (Cygwin)C generated exe file using in Netbeans java with process -
i have c file called generator.c , using cygwin64 run make , generator.exe gets created
bhulku-parvat@dasnadas /cygdrive/c/users/bhulku-parvat/desktop/bloom-filter $ make make: nothing done 'all'. $ ./bloomgenerator.exe test 4 0.0003 'c:\users\bhulku-parvat\desktop' 'c:\users\bhulku-parvat\desktop\rawdata.txt'
and when run in cygwin give 5 parameter ,it succesfully runs , generate desired ouput new file in specified loaction
following java code
public class bloomtest {
public static void main(string[] args) { runtime run = runtime.getruntime(); process p; system.out.println("----sart----"); string cmmd[] = new string[3]; try { cmmd[0] = "c:/cygwin64/bin/bash.exe"; cmmd[1] = "-c"; cmmd[2] = "'c:\\users\\bhulku-parvat\\desktop\\bloom-filter\\bloomgenerator.exe' 'testqw', '4', '0.0003', 'c:/users/bhulku-parvat/desktop' ,'c:/users/bhulku-parvat/desktop/rawdata.txt'"; p = run.exec(cmmd); p.waitfor(); bufferedreader reader; reader = new bufferedreader(new inputstreamreader(p.geterrorstream())); string line = reader.readline(); while (line != null) { system.out.println(line); line = reader.readline(); } } catch (exception ex) { ex.printstacktrace(); logger.getlogger(bloomtest.class.getname()).log(level.severe, null, ex); } }
the problem want run same command in java through netbeans using process or processbuilder unable run me out
it gives following output
/usr/bin/bash: c:\users\bhulku-parvat\desktop\bloom-filter\bloomgenerator.exe: command not found
Comments
Post a Comment