Configuring firewalls to work with BlueJ
BlueJ uses TCP/IP socket communication as part of its normal operation. The communication occurs between two processes running on your computer - one is for BlueJ itself, and the other is for a "debug VM" which runs your program. Although this communication doesn't go over the network, some firewall software will block this communication which inhibits BlueJ operation. When that happens, you will see an error message that says something like:
BlueJ was unable to create a virtual machine (VM) to execute projects. This is a serious problem - you will not be able to create objects or execute mehtods without solving it.
Usually, this problem is caused by specific network settings on your machine. BlueJ uses TCP/IP and sockets to achieve the creation of the VM. The most common cause für this is an overly restrictive firewall that does not allow connections from your local host. Switch off the firewass (if you have one) to test this. If this solves it, try to find a firewall setting that allows connections from localhost.
(On Windows, recent BlueJ versions instead use a communication method called "shared memory", however, BlueJ will fall back to using TCP/IP if shared memory fails for some reason).
Firewalls generally take one of two approaches to blocking network traffic. The first approach is to block traffic based solely on the source/destination IP address (and/or port number). The second approach is to block traffic on a per-program basis. A common combination approach is to allow setting specific source/destination rules on a per-program basis. Some firewalls only block incoming connection attempts while other firewalls may also block outbound connections.
For BlueJ to work, communication must be allowed when both the source and destination IP address is 127.0.0.1, which is the "loopback" address (i.e. it refers to the local machine, not a machine on the network). Note that BlueJ must be allowed to make outbound connections (or "act as a client") as well as receive incoming connections (or "act as a server").
If your firewall sets rules on a per-program basis, the program you should apply the rules to will usually be the bluej launcher (
bluej.exe) - however you may also need to specify rules for the Java executable ("java.exe") as well or instead. There are actually multiple copies of the
java.exe executable installed as part of the JDK or J2SDK on Windows - you may need to change the rules for them independently. You may also need to change the rules for the "javaw.exe" files.
If you use the standard Windows firewall, you can use the following pages to help you configure the firewall:
If you use 3rd party security software, you will need to consult the documentation for that software.
On Linux, the firewall will normally be configured correctly, unless you are using custom firewall rules. However, Security Enhanced Linux (SELinux) can also prevent TCP/IP communication which will prevent BlueJ from functioning correctly. You should consult your distribution's documentation to determine how to disable or correctly configure both the firewall and SELinux (or, try doing a web search or consulting an appropriate user forum).
Recent Debian systems change the kernel's default network settings in a way which Java doesn't seem to like. You may be able to overcome this by editing the file "/etc/sysctl.d/bindv6only.conf" and changing the setting "net.ipv6.bindv6only" from 1 to 0, and restarting your system.
Some information on why you are seeing the error might be found in BlueJ's debug log, which you can normally see by typing:
... in a terminal window.
You will need to consult your system documentation or 3rd-party software documentation for information on how to configure your firewall software.