Is it bad to call shell commands from Java? [closed] Is it bad to call shell commands from Java? [closed] shell shell

Is it bad to call shell commands from Java? [closed]


Using a shell script would add extra dependencies to your application, also it may make your application platform-dependent. E.g. on OS without comm.

Have you tried InputStream to process the files? It won't load the whole content in memory. If comm does what you need, it means, you just want to do line by line diff, you can give InputStream a try.

side note, if you are about to use comm, you should make sure, your files are already sorted.


1.You can call a cmd command with a ProccessBuilder object2.In my opinion there are more efficient ways(Batch files e.t.c)