Where people put "-Dhttp.proxyHost=your.proxy.net -Dhttp.proxyPort=8080" on IntelliJ?

My Spring Boot application uses RestTemplate to make HTTP requests. But because it works on a corporate network it doesn’t have direct access to the internet. It needs to use proxy. I have set a proxy into my IntelliJ but I guess RestTemplate doesn’t use IntelliJ’s proxy settings. I think I can use this method but I have no idea where to put it. My question is where should I set -Dhttp.proxyHost=your.proxy.net -Dhttp.proxyPort=8080?

>Solution :

Click your run target, then "Edit configurations". Under "Modify options" (blue text) click "Add VM options", then add the parameter to the new field that appears.

No, I don’t know why they hid it away like that either. It used to be always available, much easier.

Leave a Reply