Skip to content

Commit 740b817

Browse files
committed
upgrade Java backend from OpenJDK 7 to Oracle's Java 8
1 parent fdfc737 commit 740b817

3 files changed

Lines changed: 13 additions & 78 deletions

File tree

‎v4-cokapi/Dockerfile‎

Lines changed: 0 additions & 72 deletions
This file was deleted.

‎v4-cokapi/backends/java/Dockerfile‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Java visualizer backend using Oracle's Java 8
2+
13
# to build:
24
# docker build -t="pgbovine/cokapi-java:v1" .
35
#
@@ -7,23 +9,28 @@
79
# remember --rm or else stale old containers will be left around!
810
# use "docker ps -a" to see all containers
911

10-
# don't use 'latest' tag since that might change
11-
FROM ubuntu:14.04.1
12+
# need to use at least 16.04 to get Java 8
13+
FROM ubuntu:16.04
1214
MAINTAINER Philip Guo <philip@pgbovine.net>
1315

1416
# if apt-get doesn't work, then follow these instructions:
1517
# http://stackoverflow.com/questions/24991136/docker-build-could-not-resolve-archive-ubuntu-com-apt-get-fails-to-install-a
1618
# Uncomment the following line in /etc/default/docker DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
1719
# Restart the Docker service sudo service docker restart
18-
RUN apt-get update && apt-get install -y \
19-
openjdk-7-jdk
20+
21+
# Follow these instructions for installing Oracle's official Java 8
22+
# http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html
23+
RUN apt-get update && apt-get install -y software-properties-common
24+
RUN apt-add-repository ppa:webupd8team/java
25+
RUN apt-get update
26+
RUN yes | apt-get install -y oracle-java8-installer # pipe 'y' using 'yes' to agree to Oracle's terms of service for installer
2027
2128
RUN mkdir /tmp/java_jail
2229
RUN mkdir /tmp/java_jail/cp
2330
ADD java_jail/cp/ /tmp/java_jail/cp
2431
2532
# compile all Java files within cp/
26-
RUN cd /tmp/java_jail/cp && find . -name "*.java" -print | xargs javac -Xlint:unchecked -cp .:javax.json-1.0.jar:/usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar
33+
RUN cd /tmp/java_jail/cp && find . -name "*.java" -print | xargs javac -Xlint:unchecked -cp .:javax.json-1.0.jar:/usr/lib/jvm/java-8-oracle/lib/tools.jar
2734
2835
COPY run-java-backend.sh /tmp/
2936
RUN chmod a+x /tmp/run-java-backend.sh

‎v4-cokapi/backends/java/run-java-backend.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
# echo doesn't work here since it interprets '\n' and other chars
1111
#
1212
# TODO: try different -Xmx512m memory settings depending on user needs
13-
cat <<ENDEND | java -Xmx512m -cp /tmp/java_jail/cp:/tmp/java_jail/cp/javax.json-1.0.jar:/usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar:/tmp/java_jail/cp/visualizer-stdlib traceprinter.InMemory
13+
cat <<ENDEND | java -Xmx512m -cp /tmp/java_jail/cp:/tmp/java_jail/cp/javax.json-1.0.jar:/usr/lib/jvm/java-8-oracle/lib/tools.jar:/tmp/java_jail/cp/visualizer-stdlib traceprinter.InMemory
1414
$1
1515
ENDEND

0 commit comments

Comments
 (0)