Skip to content

jenkins: Requires Java 1.8, but no longer installable #39037

@saschakettler

Description

@saschakettler

What you were trying to do (and why)

I'm trying to install Jenkins on a fresh Homebrew installation.

What happened (include command output)

Jenkins fails to install, as Java 1.8 is required, but no longer installable (see homebrew-cask-versions/issues/7253)

$ brew install jenkins
jenkins: Java 1.8 is required to install this formula.
JavaRequirement unsatisfied!
You can install with Homebrew Cask:
  brew cask install homebrew/cask-versions/java8
You can download from:
  https://www.oracle.com/technetwork/java/javase/downloads/index.html
Error: An unsatisfied requirement failed this build.

What you expected to happen

Have Jenkins installed with a supported JVM

Step-by-step reproduction instructions (by running brew install commands)

$ brew install jenkins
jenkins: Java 1.8 is required to install this formula.
JavaRequirement unsatisfied!
You can install with Homebrew Cask:
  brew cask install homebrew/cask-versions/java8
You can download from:
  https://www.oracle.com/technetwork/java/javase/downloads/index.html
Error: An unsatisfied requirement failed this build.

$ brew cask install homebrew/cask-versions/java8
==> Caveats
Installing java8 means you have AGREED to the license at:
  https://www.oracle.com/technetwork/java/javase/terms/license/javase-license.html

==> Satisfying dependencies
==> Downloading https://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-macosx-x64.dmg
==> Downloading from https://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-macosx-x64.dmg?AuthPara

curl: (22) The requested URL returned error: 404 Not Found
Error: Download failed on Cask 'java8' with message: Download failed: https://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-macosx-x64.dmg

Workaround

Change the formula to switch to Java 11 (Java 12 is not supported) to avoid users having to deal with outdated Java 1.8 or using an unlicensed copy by accident.

The following is my proposed changes that work fine for me:

diff --git a/Formula/jenkins.rb b/Formula/jenkins.rb
index c224540791..0ee01bdee0 100644
--- a/Formula/jenkins.rb
+++ b/Formula/jenkins.rb
@@ -11,7 +11,7 @@ class Jenkins < Formula

   bottle :unneeded

-  depends_on :java => "1.8"
+  depends_on :java => "11"

   def install
     if build.head?
@@ -20,8 +20,8 @@ class Jenkins < Formula
       system "jar", "xvf", "jenkins.war"
     end
     libexec.install Dir["**/jenkins.war", "**/jenkins-cli.jar"]
-    bin.write_jar_script libexec/"jenkins.war", "jenkins", :java_version => "1.8"
-    bin.write_jar_script libexec/"jenkins-cli.jar", "jenkins-cli", :java_version => "1.8"
+    bin.write_jar_script libexec/"jenkins.war", "jenkins", :java_version => "11"
+    bin.write_jar_script libexec/"jenkins-cli.jar", "jenkins-cli", :java_version => "11"
   end

   def caveats; <<~EOS
@@ -42,7 +42,7 @@ class Jenkins < Formula
         <array>
           <string>/usr/libexec/java_home</string>
           <string>-v</string>
-          <string>1.8</string>
+          <string>11</string>
           <string>--exec</string>
           <string>java</string>
           <string>-Dmail.smtp.starttls.enable=true</string>

Metadata

Metadata

Assignees

No one assigned

    Labels

    outdatedPR was locked due to age

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions