Fix name of machine mutex in installJava() method and update to use DynamicTasks