Extend the Jenkins agent definition by installing Java 8 in a separate directory. Define a Jenkins tool for Java 8 and have the job definition reference that tool. Refer a previous answer for more details and refer to this video by Darin Pope
1 Like