Error on IntelliJ startup (java.net.BindException: Address already in use: bind)
Error on IntelliJ startup (java.net.BindException: Address already in use: bind)
IntelliJ, which I'd been using without any issues up until just yesterday, crashed with an error the moment I opened it after getting home from work.
Two error windows popped up. One was the java.net.BindException: Address already in use: bind error shown above, and the other was some NullPointerException. Since the NullPointerException happened to appear on top, I was searching for the wrong thing entirely — but once I moved the window, I found the other error hiding behind it.
It seems to be related to Hyper-V, Windows' virtual OS machine. Apparently, when Windows boots, Hyper-V reserves a port for itself, and this happened to collide with IntelliJ's port. But why now, all of a sudden?
As it happens, I do use Hyper-V. I'm running CentOS 8 and Windows 10. I installed a DB on CentOS 8 to get some hands-on experience with Linux as well, so whenever I need a DB while coding at home, I just connect to that. Windows 10 is what I use when I need a clean PC or have to do internet banking, which I despise (those plugins, ugh...), but I hadn't used it in almost 3 months. I've heard Windows Update sometimes changes settings on its own, so maybe that's the cause... It's a common story: something that used to work fine suddenly stops working for some reason. Whatever mysterious force kept it working until now, I have no idea what it was.
Run the Windows console as administrator. It doesn't matter which console you use — cmd, PowerShell, or anything else that can run commands. Enter the following commands into the console.
BATCH
# Hyper-V 비활성화 (윈도우 재부팅 필요) dism.exe /Online /Disable-Feature:Microsoft-Hyper-V # TCPv6 6942 ~ 6952 포트 예약 netsh int ipv6 add excludedportrange protocol=tcp startport=6942 numberofports=10 # Hyper-V 활성화 (윈도우 재부팅 필요) dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All
Enabling and disabling Hyper-V each require a reboot. After that, IntelliJ started up normally, but it seemed like Hyper-V itself wasn't working properly. Even after turning the OS on, it wouldn't get past "Starting". I reinstalled the Hyper-V feature, rebooted, and tried again, but it still didn't work... or so I thought — after leaving it alone for a while, it worked fine. Apparently this can happen with any program in the IntelliJ family.
It doesn't feel like a clean resolution, but I'm glad it's sorted out either way.
![[Baekjoon / JAVA] Baekjoon Algorithm Problem 1013 - Contact](https://user-images.githubusercontent.com/50317129/120028591-d5ece480-c02f-11eb-88f0-e14fc647dd81.png)
![[JAVA] split vs StringTokenizer](https://www.textrazor.com/img/letters3.png)