Task added to set the JAVA_HOME variable

A new task has been added to set the JAVA_HOME environment variable.
This is necessary to allow other programs with dependencies on java to
find the correct binary and allow proper functioning of the whole
system.