Netbeans or Eclipse on macOS Sierra - Java problems
You need to install the full JDK version of Java 8 (jdk-8u121-macosx-x64.dmg) rather than just the JRE.

The JRE install does not include the support to run Java programs outside of a browser.