Okay, there is a much easier way of switching the Java SDK for WebStorm. Just press shift twice to invoke WebStorm's Search Everywhere feature, type in "Switch Boot JDK" and select the "Switch IDE boot JDK..." action. Then select your JDK, you want to use.
That's much better than using a bash script as mentioned below, because you can start WebStorm in every possible way you want and still get the correct JDK. :)
Side note: If you don't see your custom SDK in that list, you may need to start WebStorm once with the method described below or take a look here.
If you want to start WebStorm with a custom Java SDK, you can use this little bash script:
WEBSTORM_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/ export WEBSTORM_JDK open -a "/Applications/WebStorm 12 EAP.app/Contents/MacOS/webstorm"
You may need to adjust
WebStorm 12 EAP.app to suit your needs.
You wonder why you should start WebStorm with a custom JDK? After upgrading to Yosemite long long time ago WebStorm had a poor performance while scrolling, it even did some flickering. Somewhere in the linked issue or its related one's JetBrains recommended to start WebStorm with a custom JDK for a better and smoother font rendering, preventing the poor scroll performance and flickering. Since then I'm using a custom JDK which makes me feel that my WebStorm is on steroids. Careful: This is highly subjective. ;-)