I have two projects on my computer that require JAVA_HOME to point to jdk7 and 8 respectively.
Right now I'm working around this by having 2 files in my home folder that i source to set JAVA_HOME correctly whenever I move to the root folder of one of these folders.
Is there a way I can tie the sourcing of these files to the action of "cd"ing to the root of these projects?