Mark Ashley Bell

21 Dec 2012

IntelliJ IDEA: Fixing "Permission denied: connect" Errors

I'm making my first tentative steps with Scala, and according to many sources (including Mikio Braun's excellent getting started article), the IDE of choice is IntelliJ IDEA.

However, having downloaded and installed the Community Edition, I found I was unable to install the Scala plugin; when I clicked the Browse Repositories button under the Plugins dialog, IDEA threw up a Permission denied: connect exception.

It turns out that this is due to an issue with Java 7 (which brings IPV6 support) and the Cisco AnyConnect VPN client I have installed (which seemingly doesn't support IPV6 sockets, see here).

The obvious workaround is to close the VPN client, but as I need this constantly it wasn't really practical. There is also an update to the client which may well fix the issue, but as we don't have access to download it due to Cisco's support system, the other way around this is as follows:

  1. Open the IntelliJ IDEA bin folder—in my case, C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 12.0.1\bin
  2. Open the idea.exe.vmoptions and idea64.exe.vmoptions files
  3. Add -Djava.net.preferIPv4Stack=true on a new line at the end of each file
  4. Save the files and restart IntelliJ IDEA

You should now find IDEA can connect to online endpoints successfully.

Questions or comments? Get in touch @markeebee, or email [Turn On Javascript To View Email Address].

More articles

© Mark Ashley Bell 2023