You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/06/05 20:29:09 UTC

[GitHub] houshengbo closed pull request #3720: Update the document regarding Open JDK and Oracle JDK

houshengbo closed pull request #3720: Update the document regarding Open JDK and Oracle JDK
URL: https://github.com/apache/incubator-openwhisk/pull/3720
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/README.md b/README.md
index 172580c17c..842178f817 100644
--- a/README.md
+++ b/README.md
@@ -75,6 +75,8 @@ wsk action invoke /whisk.system/utils/echo -p message hello --result
 These steps were tested on Mac OS X El Capitan, Ubuntu 14.04.3 LTS and Windows using Vagrant.
 For more information about using OpenWhisk on Vagrant see the [tools/vagrant/README.md](tools/vagrant/README.md)
 
+During the Vagrant setup, Open JDK 8 is used as the default Java environment. If you would like to use Oracle JDK 8, please change the line "su vagrant -c 'source all.sh'" into "su vagrant -c 'source all.sh oracle'" in tools/vagrant/Vagrantfile.
+
 ### Native development
 
 Docker must be natively installed in order to build and deploy OpenWhisk.
diff --git a/tools/macos/README.md b/tools/macos/README.md
index 4298b581f2..c4cef3a3c5 100644
--- a/tools/macos/README.md
+++ b/tools/macos/README.md
@@ -27,7 +27,7 @@ If you prefer to use Docker-machine, you can follow instructions in [docker-mach
 The following are required to build and deploy OpenWhisk from a Mac host:
 
 - [Docker 1.12.0](https://docs.docker.com/docker-for-mac/)
-- [Java 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
+- [Java 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html) or [Open JDK 8](https://adoptopenjdk.net/releases.html#x64_mac)
 - [Scala 2.11](http://scala-lang.org/download/)
 - [Ansible 2.5.2](http://docs.ansible.com/ansible/intro_installation.html)
 
@@ -54,6 +54,24 @@ sudo easy_install pip
 sudo -H pip install docker==2.2.1 ansible==2.5.2 jinja2==2.9.6 couchdb==1.1 httplib2==0.9.2 requests==2.10.0' | bash
 ```
 
+The above section of command installs Oracle JDK 8 as the default Java environment. If you would like to install Open JDK 8 instead of Oracle JDK 8, please run the following section.
+
+```
+echo '
+# install homebrew
+/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
+# install for finding alternative versions (Open JDK 8)
+brew tap AdoptOpenJDK/openjdk
+# install Open JDK 8
+brew install adoptopenjdk-openjdk8
+# install scala
+brew install scala
+# install pip
+sudo easy_install pip
+# install script prerequisites
+sudo -H pip install docker==2.2.1 ansible==2.5.2 jinja2==2.9.6 couchdb==1.1 httplib2==0.9.2 requests==2.10.0' | bash
+```
+
 # Build
 ```
 cd /your/path/to/openwhisk
diff --git a/tools/ubuntu-setup/README.md b/tools/ubuntu-setup/README.md
index e563beb3ec..ceabcd731f 100644
--- a/tools/ubuntu-setup/README.md
+++ b/tools/ubuntu-setup/README.md
@@ -32,11 +32,22 @@ The commands below should be executed on the host machine for single VM/server d
 
   # Change current directory to openwhisk
   cd openwhisk
+  ```
+
+Open JDK 8 is installed by running the following script as the default Java environment.
 
+  ```
   # Install all required software
   (cd tools/ubuntu-setup && ./all.sh)
   ```
 
+If you choose to install Oracle JDK 8 instead of Open JDK 8, please run the following script.
+
+  ```
+  # Install all required software
+  (cd tools/ubuntu-setup && ./all.sh oracle)
+  ```
+
 If you are deploying OpenWhisk in a distributed environment across multiple VMs, then follow the instructions in [ansible/README_DISTRIBUTED.md](../../ansible/README_DISTRIBUTED.md) to complete the deployment. Otherwise, continue with the instructions below.
 
 ### Select a data store
diff --git a/tools/ubuntu-setup/all.sh b/tools/ubuntu-setup/all.sh
index 2f84d5789d..21a37ff9c0 100755
--- a/tools/ubuntu-setup/all.sh
+++ b/tools/ubuntu-setup/all.sh
@@ -25,6 +25,9 @@
 
 set -e
 set -x
+
+JAVA_SOURCE=${1:-"open"}
+
 SOURCE="${BASH_SOURCE[0]}"
 SCRIPTDIR="$( dirname "$SOURCE" )"
 
@@ -35,7 +38,7 @@ echo "*** installing python dependences"
 /bin/bash "$SCRIPTDIR/pip.sh"
 
 echo "*** installing java"
-/bin/bash "$SCRIPTDIR/java8.sh"
+/bin/bash "$SCRIPTDIR/java8.sh" $JAVA_SOURCE
 
 echo "*** installing ansible"
 /bin/bash "$SCRIPTDIR/ansible.sh"
diff --git a/tools/ubuntu-setup/java8.sh b/tools/ubuntu-setup/java8.sh
index 73770f4e01..bda7090947 100755
--- a/tools/ubuntu-setup/java8.sh
+++ b/tools/ubuntu-setup/java8.sh
@@ -19,10 +19,20 @@
 set -e
 set -x
 
-if [ "$(lsb_release -cs)" == "trusty" ]; then
+JAVA_SOURCE=${1:-"open"}
+
+if [ "$JAVA_SOURCE" != "oracle" ] ; then
+    if [ "$(lsb_release -cs)" == "trusty" ]; then
+        sudo apt-get install -y software-properties-common python-software-properties
+        sudo add-apt-repository ppa:jonathonf/openjdk -y
+        sudo apt-get update
+    fi
+
+    sudo apt-get install openjdk-8-jdk -y
+else
     sudo apt-get install -y software-properties-common python-software-properties
-    sudo add-apt-repository ppa:jonathonf/openjdk -y
+    sudo add-apt-repository ppa:webupd8team/java -y
     sudo apt-get update
-fi
 
-sudo apt-get install openjdk-8-jdk -y
+    sudo apt-get install oracle-java8-installer -y
+fi
diff --git a/tools/vagrant/Vagrantfile b/tools/vagrant/Vagrantfile
index 2494dd98a5..77764a5e84 100644
--- a/tools/vagrant/Vagrantfile
+++ b/tools/vagrant/Vagrantfile
@@ -87,7 +87,7 @@ Vagrant.configure('2') do |config|
       echo PATH=${PATH}:${HOME}/bin:${OPENWHISK_HOME}/tools/build >> /etc/environment
       cd ${OPENWHISK_HOME}
       cd tools/ubuntu-setup
-      su vagrant -c 'source all.sh'
+      su vagrant -c 'source all.sh oracle'
       echo "`date`: ubuntu-setup-end" >> /tmp/vagrant-times.txt
     SCRIPT
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services