I'm trying to run a jar file through a socks proxy. If I only had one jar, it would probably work to just change system variables, but I need to run like 20 jar files at the same time, all with different proxies. How do I accomplish this?


Set different proxy properties for each of them, as needed, for example in a shell script:

java -Dhttp.proxyHost= -Dhttp.proxyPort=8800 -jar path/to/program1.jar
java -Dhttp.proxyHost= -Dhttp.proxyPort=8801 -jar path/to/program2.jar
java -Dhttp.proxyHost= -Dhttp.proxyPort=8802 -jar path/to/program3.jar
  • java.io.IOException: Invalid Http response – sergbot Dec 25 '16 at 19:35
  • Can you get any of the jar files run with a proxy? If yes, follow the same procedure for the others. If no, that's a different question, not an issue with multiple proxies, but a more basic issue of using a proxy at all. – Stop ongoing harm to Monica Dec 25 '16 at 19:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.