ブログ - JenkinsとJava 9のJDKをインストール
Jenkinsをインストールする.主な目的は,バッチ処理をさせるだけなので大げさだけれど.
まずはJenkinsのパッケージを確認.
デフォルトでは8080ポートで動作するとのこと.インストールする.
Java 1.8が必要と記載してあるが,一層の事,最新の1.9を入れてみる.
インストールが成功した模様.正しくインストールされたか確認する,
・ファイルパスの確認
・バージョンの確認
・インストールされている全てのJavaのバージョン確認.
環境変数を設定し,確認する.
Jenkinsをインストールする.
やっぱりJava8が必要な模様.なのでインストールする.
無事インストールできた模様
早速起動してプロセスを確認.
起動していることが確認できました.
まずはJenkinsのパッケージを確認.
$ brew info jenkins🆑
jenkins: stable 2.114, HEAD
Extendable open source continuous integration server
https://jenkins.io/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/jenkins.rb
==> Requirements
Required: java = 1.8 ✘
==> Options
--HEAD
Install HEAD version
==> Caveats
Note: When using launchctl the port will be 8080.🈁
To have launchd start jenkins now and restart at login:
brew services start jenkins
Or, if you don't want/need a background service you can just run:
jenkins
$
$ brew install jenkins🆑
jenkins: Java 1.8 is required to install this formula.
JavaRequirement unsatisfied!
You can install with Homebrew-Cask:
brew cask install caskroom/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 caskroom/versions/java9🆑
==> Caveats
This Cask makes minor modifications to the JRE to prevent issues with
packaged applications, as discussed here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361
If your Java application still asks for JRE installation, you might need
to reboot or logout/login.
Installing this Cask means you have AGREED to the Oracle Binary Code
License Agreement for Java SE at
https://www.oracle.com/technetwork/java/javase/terms/license/index.html
==> Satisfying dependencies
==> Downloading http://download.oracle.com/otn-pub/java/jdk/9.0.4+11/c25
14751926b4512b076cc82f959763f/jdk-9.0.4_osx-x64_bin.dmg
####################################################### 100.0%
==> Verifying checksum for Cask java9
==> Installing Cask java9
==> Running installer for java9; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
Password:
==> installer: Package name is JDK 9.0.4
==> installer: Upgrading at base path /
==> installer: The upgrade was successful.
🍺 java9 was successfully installed!
$
・ファイルパスの確認
・バージョンの確認
・インストールされている全てのJavaのバージョン確認.
$ which java🆑
/usr/bin/java
$
$ /usr/bin/java -version🆑
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
$
$ /usr/libexec/java_home -V🆑
Matching Java Virtual Machines (1):
9.0.4, x86_64: "Java SE 9.0.4" /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
$
$ export JAVA_HOME=`/usr/libexec/java_home -v 9`🆑
$ echo $JAVA_HOME🆑
/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
$
$ brew install jenkins🆑
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core, caskroom/cask).
==> Updated Formulae
jenkins-job-builder jhipster
==> Deleted Formulae
arm
jenkins: Java 1.8 is required to install this formula.🈁
JavaRequirement unsatisfied!
You can install with Homebrew-Cask:
brew cask install caskroom/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 caskroom/versions/java8🆑
==> Caveats
This Cask makes minor modifications to the JRE to prevent issues with
packaged applications, as discussed here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361
If your Java application still asks for JRE installation, you might need
to reboot or logout/login.
Installing this Cask means you have AGREED to the Oracle Binary Code
License Agreement for Java SE at
https://www.oracle.com/technetwork/java/javase/terms/license/index.html
==> Satisfying dependencies
==> Downloading http://download.oracle.com/otn-pub/java/jdk/8u162-
b12/0da788060d494f5095bf8624735fa2f1/jdk-8u162-macosx-x64.dmg
#########################################################
############### 100.0%
==> Verifying checksum for Cask java8
==> Installing Cask java8
==> Running installer for java8; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
Password:🔑
==> installer: Package name is JDK 8 Update 162
==> installer: Installing at base path /
==> installer: The install was successful.
🍺 java8 was successfully installed!🈁
$
早速起動してプロセスを確認.
$ brew services start jenkins🆑
==> Successfully started `jenkins` (label: homebrew.mxcl.jenkins)
$
$ ps -ef|grep jenkins🆑
501 26259 1 0 12:37AM ?? 0:43.92 /Library/Java/JavaVirtualMachines
/jdk1.8.0_162.jdk/Contents/Home/bin/java -Dmail.smtp.starttls.enable=true -jar
/usr/local/opt/jenkins/libexec/jenkins.war --httpListenAddress=127.0.0.1
--httpPort=8080
501 27042 25896 0 12:38AM ttys000 0:00.01 grep jenkins
$