Loading /etc/hosts does not in Run mode
Answered
I have code where i set property jdk.net.hosts.file to load etc/hosts file for DNS configuration to connect to DB, i was able to run the program and connect to DB when i run the code in the debug mode but when i run it in run mode it fails because it does not load the /etc/hosts file. Code works in Eclipse, any idea why Intellj does not load /etc/hosts in run mode?
JDK - 11
System.setProperty("jdk.net.hosts.file", "/etc/hosts");
Please sign in to leave a comment.
Seems similar to https://youtrack.jetbrains.com/issue/IDEA-269649
If possible, please share a sample project where this could be reproduced.