Ok, I usually say good things about java and apple, but this post actually is to make a workaround for an awful issue, that really pissed me off for some time. If you want to use Netbeans on Snow Leopard or even Eclipse there’s some things that you must know, like always install the software using a Java6 JVM as your default JVM, don’t use Java 5 because apple made some mistakes and some things that should be exclusive for Java 5 got override by Java 6, I know don’t ask. hehe, so even if you will use Java 5 for your projects, please for Leopard and Snow Leopard install netbeans using Java 6. There something that was really upsetting me: every time I want to compile any of my projects I got an error like couldn’t connect on socket, transport something. Well after a lot of headache I could see that this issue is related to your HOSTNAME, Leopard has a strange behavior that changes your hostname and got a new one from your DNS server, so if your machine is inside a local network probably you will not have this issue, but if you connect directly then it’s gonna be pain, a lot of pain. I know some programmers edit the /etc/hostname file and some of them could work around this bug, I went for a more drastic solution, but I think makes more sense, I just don’t want that my computer changes hostname everytime so the following commands will not let Leopard/Snow Leopard change your hostname.
sudo hostname whateveryouwant.local sudo scutil --set HostName whateveryouwant.local sudo scutil --set LocalHostName whateveryouwant
Once this is done, the name should stick permanently.
BTW – this error happens on eclipse exactly the same way.






