Linked Questions

28 questions linked to/from How to execute command with parameters?
4 votes
4 answers
21k views

Process p; String line; String path; String[] params = new String [3]; params[0] = "D:\\prog.exe"; params[1] = picA+".jpg"; params[2] = picB+".jpg"; try { p = Runtime.getRuntime().exec(params); ...
questioner's user avatar
  • 2,293
2 votes
1 answer
3k views

Process p; String cmd = "rsync --timeout=20 -v -r -E -e \"ssh -o StrictHostKeyChecking=no -i " + "/usr/local/my.pem\"" + " root@<IP>:/usr/local/test/...
Bhuvan's user avatar
  • 4,235
0 votes
2 answers
960 views

I want to use WordNet and its packages for which I am using wn.exe and need to pass "-n#" argument to it. How do I do it from within my java code which is running on the computer. ***Edit: I have a ...
0 votes
0 answers
1k views

I am trying to execute the openssl command for encryption. I am trying to launch the openssl via java runtime. import java.io.BufferedReader; import java.io.InputStreamReader; public class ...
GAK's user avatar
  • 1,108
2 votes
0 answers
692 views

I face a problem to run a ".sh" file from my Java code, which is written in bash. At this point, I am using the following command to run the script (which is in the local directory, and seems to be ...
MatthChtp's user avatar
-1 votes
2 answers
249 views

I am working on a Spring based application in which we would like to use ImageMagick for some image processing. We have some commands, which I want to try out after text-processing(mainly splitting ...
We are Borg's user avatar
  • 5,313
18 votes
4 answers
17k views

This might already been answered before but that was regarding unicode and I don't think this is unicode (it's in ASCII so...). When I execute this in my terminal there is no problem what so ever ...
9 votes
8 answers
22k views

I am writing a small Java Application and I am having problems with a filepath. I want to execute a batch file with Runtime.getRuntime().exec("cmd /c start c:\program files\folder\file.bat"); But ...
2 votes
2 answers
17k views

i am trying to run this java code that calls the shell script on runtime. when i run the script in terminal i am passing argument to script code: ./test.sh argument1 java code: public class ...
milano's user avatar
  • 475
2 votes
5 answers
1k views

So I am trying to make a universal app, and I am trying to make it have the ability to open applications. So, I figured out to make it open an application if it is one word, but with spaces, it never ...
4 votes
4 answers
5k views

I have bash script that takes in a couple of arguments tests then and runs a command as shown below call script => /bin/bash myscript arg1 arg2 arg3 arg4 comm called => command -a arg1 -b arg2 -...
2 votes
1 answer
6k views

Okay so here is the problem: I have 3 classes MyClass1 and MyClass2 and ExecClass. I go to my command prompt and do this: $java MyClass1 -exec "java MyClass2 arg1 arg2" which works perfectly. Now in ...
2 votes
2 answers
3k views

I am trying to run this line of code: Process p = Runtime.getRuntime().exec(new String[] {"nmap -sP 192.168.1.0/24", g}); The above gives this error: Exception in thread "main" java.io.IOException: ...
0 votes
3 answers
4k views

I was trying to run a unix command in java to overlook the double quotation mark in a parsed file: for(int i = 0; i < numTables; i++){ try{ String command = "sed -e \'s/\"/\...
0 votes
1 answer
2k views

I am trying to send REST request by sending CURL command with Java Process Runtime with the code: Process p = Runtime.getRuntime().exec("curl -i --user user_name:password -H \"Content-Type: ...
Ethan's user avatar
  • 21

15 30 50 per page
1
2