Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-11992

Win7 x64: x86 Java runtime creates bad PATH on x64 OS causing ' \Java\jre6\bin"" was unexpected at this time.' error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: remoting
    • Labels:
      None
    • Environment:
      Win7 x64
    • Similar Issues:

      Description

      Win7 x64: x86 Java runtime creates bad PATH on x64 OS causing ' \Java\jre6\bin"" was unexpected at this time.' error

      I had installed the x86 Java 6, Version 6 update 29, (build 1.6.0_29-b11), which installs into C:\Program Files (x86)\Java\jre6. When I started the jenkins client and ran a build I received ' \Java\jre6\bin"" was unexpected at this time.' errors in the console any time a shell command was invoked on the slave.

      Upon investigation it appears that the Java runtime set to path to (as reported by the Manage Jenkins --> Manage Nodes --> My Slave --> Systeminfo page:

      C:\Program Files (x86)\Java\jre6\bin;...;"C:\Program Files (x86)\Java\jre6\bin"

      Searching about on the internet I see several projects reporting issues about unescaped parens being added to the path.
      https://issues.apache.org/jira/browse/GERONIMO-5365
      https://forums.oracle.com/forums/thread.jspa?threadID=2171702

      I can work around this issue by using the x64 JRE on 64-bit OS.

        Attachments

          Issue Links

            Activity

            Hide
            astraujums Atis Straujums added a comment - - edited

            Our solution (workaround) to this problem was to install Java in a location without spaces in the path.

            Show
            astraujums Atis Straujums added a comment - - edited Our solution (workaround) to this problem was to install Java in a location without spaces in the path.
            Hide
            abeben Adam Beben added a comment -

            For me workaround to this problem was to add JAVA_HOME environement variable pointing to jdk. eg: C:\Java\jdk1.8.0_66

            Show
            abeben Adam Beben added a comment - For me workaround to this problem was to add JAVA_HOME environement variable pointing to jdk. eg: C:\Java\jdk1.8.0_66
            Hide
            robertg2 Robert Grampp added a comment -

            The description is misleading. It's not the Java runtime that set the path the wrong way.
            It is Jenkins, that adds the PATH element illegally surrounded by quotes!
            Thus the Jenkins code has to be corrected.
            Neither on Windows nor (IMHO) on unixoid systems a PATH element is surrunded by quote signs.
            It's annoying to have either the PATH be corrected at beginning of the Jenkins job definition or moving the JRE to a path not containing blanks.

            Show
            robertg2 Robert Grampp added a comment - The description is misleading. It's not the Java runtime that set the path the wrong way. It is Jenkins, that adds the PATH element illegally surrounded by quotes! Thus the Jenkins code has to be corrected. Neither on Windows nor (IMHO) on unixoid systems a PATH element is surrunded by quote signs. It's annoying to have either the PATH be corrected at beginning of the Jenkins job definition or moving the JRE to a path not containing blanks.
            Hide
            sravya Sravya Pudota added a comment -

            Any updates or any temporary fixes?

            Show
            sravya Sravya Pudota added a comment - Any updates or any temporary fixes?
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Sorry, I do not have capacity to fix it.

            Anyway, running Jenkins on 64bit Windows with 32bit Java is not something stable. E.g. see https://github.com/kohsuke/winp#platform-support , you will be likely getting runaway processes when aborting builds

            Show
            oleg_nenashev Oleg Nenashev added a comment - Sorry, I do not have capacity to fix it. Anyway, running Jenkins on 64bit Windows with 32bit Java is not something stable. E.g. see https://github.com/kohsuke/winp#platform-support  , you will be likely getting runaway processes when aborting builds

              People

              • Assignee:
                Unassigned
                Reporter:
                mmacvicar Mark MacVicar
              • Votes:
                21 Vote for this issue
                Watchers:
                26 Start watching this issue

                Dates

                • Created:
                  Updated: