I wonder why, to run any program, Java needs to use the network. As my connection to the college wireless network really sucks, I get disconnected all the time, but without any notice from the access point. Thus, I cannot access the network anymore but the connection is still seen as up by the operating system. (In my case, I'm using netctl on Arch Linux.)
The result is that Java will take 20 sec waiting for something before running any code from the main() method.
This problem doesn't appear if the connection is down (from the point of view of network utilities).
Do you know why Java does that, and how to prevent it?
Edit, as it doesn't seem clear:
How to reproduce the bug :
- Use a broken gateway, such as 240.0.0.1
- Write a Java program with an empty main() method.
- Compile (javac)
- Run the program
The last step takes 20+ seconds to complete.
What I'd like you to explain is not why I'm having network issues but why Java is affected?