Reputation: 2188
I am trying to spawn a browser using a small java code
String command="rundll32 url.dll,FileProtocolHandler http://www.google.com"
Process process = Runtime.getRuntime().exec(command);
The above thing works fine. However there certain difficulties I am facing.
I tried to implement following code, but its not working:
System.setProperty("http.proxyHost", "localhost");
System.setProperty("http.proxyPort", "8080");
But what I can understand is that its for JVM and not for the browser. And I need to change this for a particular browser.
Thanks and regards.
Upvotes: 0
Views: 1044
Reputation: 5860
My answer may not fully help you but it can guide you a bit.
There is totally not related to System.setProperty. This method sets VM system property.
What you are trying to do is 'change Windows property'. Then you should find solution by Windows command (not by java) as you already did:
String command="xxxx"
Process process = Runtime.getRuntime().exec(command);
Upvotes: 2