Workarounds - majk1/shellrc GitHub Wiki
macOS java apps problems with java9
If you have an older jdk (for example jdk1.8.0_144), you can switch back to that until the java apps are ready for java 9.
To partially disable java 9 in macOS (keep jdk-9* but make the jdk1.8.0_* the default) rename the Info.plist under the jdk-9* directory:
/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Info.plist
to
/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Info.plist.disabled
After this modification, the macOS will treat java 8 as the default version, but java 9 will be usable in IDEs and in shell, if the JAVA_9_HOME environment variable is modified. To override this variable, insert the following into the ~/.customshellrc
# remove after java9 apps has been fixed
export JAVA_9_HOME=/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home