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

OS X installation - force use of Java 7 or 8

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • packaging
    • OS X 10.8, 10.9, 10.10, any recent Jenkins version

      As per request attached to comment on changes needed to OS X installer.

      When running from the command line (as opposed to instantiating a JVM programmatically), Java 7 or Java 8 on OS X has a dependency on the very old Java 6 installation for OS X, available at http://support.apple.com/kb/DL1572. When the user installs the Java 6 package from Apple, /usr/bin/java points to the Java 6 installation. Oracle Java installs into /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home. To run a Java 8 JVM from the command line, the user needs to give the full path to the "java" executable – /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java.

      The quick fix is to change the /Library/Application Support/Jenkins/jenkins-runner.sh file with the following unified diff:

      — jenkins-runner.sh 2015-05-16 16:22:42.000000000 -0400
      +++ /Library/Application Support/Jenkins/jenkins-runner.sh 2015-04-06 22:20:02.000000000 -0400
      @@ -26,6 +26,8 @@

      home=`$defaults JENKINS_HOME` && export JENKINS_HOME="$home"

      +export JAVA_HOME="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/"
      +
      add_to_args() {
      val=`$defaults $1` && args="$args --${1}=${val}"
      }
      @@ -41,5 +43,7 @@

      echo "JENKINS_HOME=$JENKINS_HOME"
      echo "Jenkins command line for execution:"
      -echo /usr/bin/java $javaArgs -jar "$war" $args
      -exec /usr/bin/java $javaArgs -jar "$war" $args
      +# echo /usr/bin/java $javaArgs -jar "$war" $args
      +# exec /usr/bin/java $javaArgs -jar "$war" $args
      +echo "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" $javaArgs -jar "$war" $args
      +exec "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" $javaArgs -jar "$war" $args

      NOTE: I didn't see the comment addition until this past week. Sorry for the delay.

            Unassigned Unassigned
            plsuh Paul Suh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: