Interview Prep/CI/CD/Jenkins Build and Agent Failures

Build using `withEnv` and `PATH+EXTRA` finds the wrong binary version.

IntermediateTroubleshootingJenkins Build and Agent Failures
Answer

Likely causes → PATH order; multiple installs; tools {} prepending a different version.

Diagnose → sh 'type -a java; java -version; echo $PATH'.

Fix → Set one source of truth for the tool version, remove conflicting entries.

Prevent → Print tool versions at the beginning of every build.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Jenkins Build and Agent Failures