Resolution
As an example, in case you have a node called vagrant-agent and the tool is called jdk-8u45. The below code is what you should use to set-up the JAVA_HOME.
node('vagrant-agent') { env.JAVA_HOME="${tool 'jdk-8u45'}" env.PATH="${env.JAVA_HOME}/bin:${env.PATH}" sh 'java -version' }