Mac OS X and multiple Java versions

How can I install an additional java on MacOS? I installed jdk8 and that works fine. but now I need a jdk7 installation for development purposes. When trying to install the old version via DMG fil...