How to allow java in the firewall on OS X Mountain Lion

I was getting a message when using Amazon EC2 command line tools:

Do you want the application “java” to accept incoming network connections?

How to allow java in the firewall on OS X Mountain Lion

You can open your firewall and security settings preference pane and click on “Firewall Options”:

How to allow java in the firewall on OS X Mountain Lion

You might be tempted to add /usr/bin/java to the list of acceptions, but that actually won’t cut it. You’ll still get the firewall warning when running Amazon Web Services Command Line Tools.

If you open terminal and run echo $JAVA_HOME it should show you the path of the java it’s using.

For me this was located at:

/System/Library/Frameworks/JavaVM.framework/Home/

What you’ll find in that folder is a bin directory and a java file inside that:

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java

If you then add that file to the list of exceptions you’ll stop receiving this flash of a popup that is prompting you to accept:

Do you want the application “java” to accept incoming network connections?

Do you want the application “java” to accept incoming network connections?

Related Posts:

This entry was posted in Mac, Tech Tips and tagged , , . Bookmark the permalink.

11 Responses to How to allow java in the firewall on OS X Mountain Lion

  1. Poltergeister says:

    But the alert problem returns after reboot. I hate Apple.

  2. Poltergeister says:

    Finally did get it to work. navigated to Java as above and included in security and privacy permissions – allow. The problem persisted. turned permissions to – block. problem alert stopped appearing. turned permissions to – allow. problem alert remained deactivated. ie it is gone.

  3. Poltergeister says:

    Didn’t work for me. – Have OS 10.8.4, Java 1.7. also repaired permissions and they were incorrectly set for java. Still didn’t work.

    You can also get the bin directory from the ‘java control panel’ console opened by system preferences/java… then Java Control Panel/Java, ‘view’ button creates window with path in 4th column.

    But anyway didn’t work setting Java here to allow incoming connections. Oh and to navigate to the bin/java you have to create at higher level to get into the plugin.

  4. peter says:

    Thanks! FYI, you can also choose to DENY access to Java in the firewall, and the popup will also stop appearing. Since I didn’t know what was running Java to ask for such permission, and I like to keep my system closed to incoming connections as much as possible, I felt it the safer.

    For those of you who don’t know, Java is a programming language, and therefore allowing incoming access to Java enables incoming access for ANY program written in that language. So this has much bigger implications that allowing something like Dropbox or Skype (PRISM notwithstanding :) ).

  5. Raven says:

    Absolutely helped me as well, stopped right away! Thanks alot Guys!

  6. braddas says:

    thank you so much – thought i was going to have to disable firewall forever!

  7. Neil van Niekerk says:

    Thank you! * lots This was driving me insane, and your clear instructions did the magic trick.

  8. Andrew Stormont says:

    I have a better solution: Remove the executable but from java with “sudo chmod -x /usr/bin/java” and replace your java apps with apps written in a proper language.

  9. CJW says:

    This problem was driving me nuts and seems to be related to Java 1.6. After uninstalling this older version, and making sure I was all up to date with Java 1.7, my problem went away. However, Photoshop CS5 requires 1.6 and re-installs it at launch. Using your solution has completely resolved the issue for me.

  10. Pat says:

    Had the same problem. Warning was flashing every 8 seconds or so. Hard to read. Googled problem and gave up. REINSTALLED Mountain Lion. Worked for two days until I restarted computer, then the flashing warning from hell reappeared. Followed instructions above and it immediately stopped. I now have my sanity back. BUT WHY did it start now after having Mac Mini and Mountain Lion all this time. I was totally up to date. Thanks for the great post.

  11. Keith says:

    Thank you so much for this post. That pop-up was driving me NUTS! :-)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>