Jenkins auto-prepends PATH with path to java. How to disable?

Skip to first unread message

Jun 10, 2021, 10:39:55 AMJun 10
to Jenkins Users

In a Free-form project I use "Inject environment variables":


However, in shell scripts `$PATH` gets an additional prefix:

    ++ echo PATH=/u01/jenkins/jdk1.7.0_55/bin:\

How to find what's causing it and finally have my java 8 in path?

Some entries were being added by `jenkins_shell` script, but I fixed that. But I still don't know who's adding the first entry - path to java 7.

    Jenkins ver. 2.222.3
    JavaScript GUI Lib: ACE Editor bundle plugin (ace-editor): 1.1
    JQuery3 API Plugin (jquery3-api): 3.5.1-1
    Job Import Plugin (job-import-plugin): 3.4
    Downstream build view (downstream-buildview): 1.9
    Git plugin (git): 4.2.2
    Apache HttpComponents Client 4.x API Plugin (apache-httpcomponents-client-4-api): 4.5.10-2.0
    Checkstyle Plug-in (checkstyle): 4.0.0
    ECharts API Plugin (echarts-api): 4.7.0-2
    Command Agent Launcher Plugin (command-launcher): 1.4
    Hudson SCP publisher plugin (scp): 1.8
    PAM Authentication plugin (pam-auth): 1.6
    Token Macro Plugin (token-macro): 2.12
    FindBugs Plug-in (findbugs): 5.0.0
    External Monitor Job Type Plugin (external-monitor-job): 1.7
    Warnings Next Generation Plugin (warnings-ng): 8.1.0
    Run Condition Plugin (run-condition): 1.3
    Trilead API Plugin (trilead-api): 1.0.6
    Pipeline: Step API (workflow-step-api): 2.22
    Warnings Plug-in (warnings): 5.0.1
    Git client plugin (git-client): 3.2.1
    OWASP Markup Formatter Plugin (antisamy-markup-formatter): 2.0
    SCM API Plugin (scm-api): 2.6.3
    EnvInject API Plugin (envinject-api): 1.7
    Subversion Plug-in (subversion): 2.13.1
    Rebuilder (rebuild): 1.31
    Bootstrap 4 API Plugin (bootstrap4-api): 4.5.0-1
    Jackson 2 API Plugin (jackson2-api): 2.11.0
    Job Configuration History Plugin (jobConfigHistory): 2.26
    Ant Plugin (ant): 1.11
    Icon Shim Plugin (icon-shim): 2.0.3
    Popper.js API Plugin (popper-api): 1.16.0-6
    Cron Column Plugin (cron_column): 1.4
    Maven Integration plugin (maven-plugin): 3.6
    Multijob plugin (jenkins-multijob-plugin): 1.33
    MapDB API Plugin (mapdb-api):
    Static Analysis Collector Plug-in (analysis-collector): 2.0.0
    Slack Notification Plugin (slack): 2.40
    Matrix Authorization Strategy Plugin (matrix-auth): 2.6.1
    Analysis Model API Plugin (analysis-model-api): 8.1.3
    Plugin Utilities API Plugin (plugin-util-api): 1.2.2
    Conditional BuildStep (conditional-buildstep): 1.3.6
    PMD Plug-in (pmd): 4.0.0
    Javadoc Plugin (javadoc): 1.5
    Folders Plugin (cloudbees-folder): 6.12
    Translation Assistance plugin (translation): 1.16
    Pipeline: SCM Step (workflow-scm-step): 2.11
    Environment Injector Plugin (envinject): 2.3.0
    next-executions (next-executions): 1.0.15
    LDAP Plugin (ldap): 1.24
    Email Extension Plugin (email-ext): 2.69
    Oracle Java SE Development Kit Installer Plugin (jdk-tool): 1.4
    Matrix Project Plugin (matrix-project): 1.14
    Pipeline: Groovy (workflow-cps): 2.80
    Mailer Plugin (mailer): 1.32
    Dashboard View (dashboard-view): 2.12
    Plain Credentials Plugin (plain-credentials): 1.7
    Parameterized Trigger plugin (parameterized-trigger): 2.36
    Forensics API Plugin (forensics-api): 0.7.0
    built-on-column (built-on-column): 1.1
    JUnit Plugin (junit): 1.29
    Structs Plugin (structs): 1.20
    HTML Publisher plugin (htmlpublisher): 1.23
    Credentials Plugin (credentials): 2.3.7
    WMI Windows Agents Plugin (windows-slaves): 1.6
    SSH Build Agents plugin (ssh-slaves): 1.31.2
    Script Security Plugin (script-security): 1.72
    Cloud Foundry Plugin (cloudfoundry): 2.3.2
    bouncycastle API Plugin (bouncycastle-api): 2.18
    Font Awesome API Plugin (font-awesome-api): 5.13.0-1
    SSH Credentials Plugin (ssh-credentials): 1.18.1
    Task Scanner Plug-in (tasks): 4.53
    CVS Plug-in (cvs): 2.16
    JavaScript GUI Lib: jQuery bundles (jQuery and jQuery UI) plugin (jquery-detached): 1.2.1
    Pipeline: Job (workflow-job): 2.39
    Build Timestamp Plugin (build-timestamp): 1.0.3 API Plugin (data-tables-api): 1.10.21-1
    JSch dependency plugin (jsch):
    Pipeline: Supporting APIs (workflow-support): 3.4
    Zentimestamp plugin (zentimestamp): 4.2
    Static Analysis Utilities (analysis-core): 1.96
    Display URL API (display-url-api): 2.3.2
    Global Slack Notifier Plugin (global-slack-notifier): 1.5
    Pipeline: API (workflow-api): 2.40
    Run Condition Extras Plugin (run-condition-extras): 0.3

Jun 14, 2021, 2:33:16 AMJun 14
to Jenkins Users
Found answer

четверг, 10 июня 2021 г. в 17:39:55 UTC+3,
Reply all
Reply to author
0 new messages