Loading /etc/hosts does not in Run mode
已回答
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");
请先登录再写评论。
Seems similar to https://youtrack.jetbrains.com/issue/IDEA-269649
If possible, please share a sample project where this could be reproduced.