MCPcopy Index your code
hub / github.com/benfry/processing4 / checkLocalHost

Method checkLocalHost

java/src/processing/mode/java/runner/Runner.java:125–141  ·  view source on GitHub ↗

Has the user screwed up their hosts file? https://github.com/processing/processing/issues/4738

()

Source from the content-addressed store, hash-verified

123 * https://github.com/processing/processing/issues/4738
124 */
125 static private void checkLocalHost() throws SketchException {
126 try {
127 InetAddress address = InetAddress.getByName("localhost");
128 if (!address.getHostAddress().equals("127.0.0.1")) {
129 System.err.println("Your computer is not properly mapping 'localhost' to '127.0.0.1',");
130 System.err.println("which prevents sketches from working properly because 'localhost'");
131 System.err.println("is needed to connect the PDE to your sketch while it's running.");
132 System.err.println("If you don't recall making this change, or know how to fix it:");
133 System.err.println("https://www.google.com/search?q=add+localhost+to+hosts+file+" + Platform.getName());
134 throw new SketchException("Cannot run due to changes in your 'hosts' file. " +
135 "See the console for details.", false);
136 }
137
138 } catch (UnknownHostException e) {
139 e.printStackTrace();
140 }
141 }
142
143
144 public VirtualMachine launch(String[] args) {

Callers 1

RunnerMethod · 0.95

Calls 4

getNameMethod · 0.95
equalsMethod · 0.45
printlnMethod · 0.45
printStackTraceMethod · 0.45

Tested by

no test coverage detected