New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 9 Support #38

Open
clehene opened this Issue Mar 14, 2017 · 20 comments

Comments

Projects
None yet
@clehene

clehene commented Mar 14, 2017

Java 9 release is imminent (currently this is set for July 27)

For reference here's the Java 9 migration guide
http://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-5657F44A-B2D7-4FB6-AAD7-295AC4533ABC

@sergiofigueras

This comment has been minimized.

Show comment
Hide comment
@sergiofigueras

sergiofigueras commented Jul 1, 2017

+1

@loia

This comment has been minimized.

Show comment
Hide comment
@loia

loia Sep 22, 2017

+1 Java 9 is out!

loia commented Sep 22, 2017

+1 Java 9 is out!

@sabareeshkkanan

This comment has been minimized.

Show comment
Hide comment
@sabareeshkkanan

sabareeshkkanan Sep 25, 2017

+1 I tried to install java 9 in alpine but no luck, i tried, jdk, jre and even server jre but i got same exact message . I didnt even try to minify it

/tmp/jdk-9/bin # ./java -version
#
A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f496de04907, pid=50, tid=51
#
# JRE version:  (9.0+181) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (9+181, mixed mode, aot, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0xced907]  Threads::create_vm(JavaVMInitArgs*, bool*)+0x267
#
# Core dump will be written. Default location: /tmp/jdk-9/bin/core
#
# An error report file with more information is saved as:
# /tmp/jdk-9/bin/hs_err_pid50.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

sabareeshkkanan commented Sep 25, 2017

+1 I tried to install java 9 in alpine but no luck, i tried, jdk, jre and even server jre but i got same exact message . I didnt even try to minify it

/tmp/jdk-9/bin # ./java -version
#
A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f496de04907, pid=50, tid=51
#
# JRE version:  (9.0+181) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (9+181, mixed mode, aot, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0xced907]  Threads::create_vm(JavaVMInitArgs*, bool*)+0x267
#
# Core dump will be written. Default location: /tmp/jdk-9/bin/core
#
# An error report file with more information is saved as:
# /tmp/jdk-9/bin/hs_err_pid50.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
@anapsix

This comment has been minimized.

Show comment
Hide comment
@anapsix

anapsix Sep 25, 2017

Owner

Yep @sabareeshkkanan, I've encountered same exact issue

Owner

anapsix commented Sep 25, 2017

Yep @sabareeshkkanan, I've encountered same exact issue

@msvab

This comment has been minimized.

Show comment
Hide comment
@msvab

msvab Sep 26, 2017

Looks like there is early preview for Alpine Linux http://jdk.java.net/9/ea. No idea how stable it is though, but it's good to see native musl branch.

msvab commented Sep 26, 2017

Looks like there is early preview for Alpine Linux http://jdk.java.net/9/ea. No idea how stable it is though, but it's good to see native musl branch.

@anapsix

This comment has been minimized.

Show comment
Hide comment
@anapsix

anapsix Sep 26, 2017

Owner

@msvab sweet.. gotta try using that

Owner

anapsix commented Sep 26, 2017

@msvab sweet.. gotta try using that

@mattnelson

This comment has been minimized.

Show comment
Hide comment
@mattnelson

mattnelson Sep 26, 2017

I tested the JDK9-ea179 alpine distribution a few weeks back. I ran a few containers from this image. I didn't notice any immediate issues, other than needing to add a few exports commands due to the default exported modules. I did try using alpine-3.6 as well, but unfortunately a non passive change was introduced when upgrading busy box that no longer recognizes non-POSIX environment variables.

gliderlabs/docker-alpine#290

FROM alpine:3.5

ENV JAVA_HOME=/opt/jdk \
    PATH=${PATH}:/opt/jdk/bin \
    LANG=C.UTF-8

RUN set -ex && \
    apk add --no-cache bash && \
    wget http://download.java.net/java/jdk9-alpine/archive/179/binaries/jdk-9-ea+179_linux-x64-musl_bin.tar.gz -O jdk.tar.gz && \
    mkdir -p /opt/jdk && \
    tar zxvf jdk.tar.gz -C /opt/jdk --strip-components=1 && \
    rm jdk.tar.gz && \
    rm /opt/jdk/lib/src.zip

mattnelson commented Sep 26, 2017

I tested the JDK9-ea179 alpine distribution a few weeks back. I ran a few containers from this image. I didn't notice any immediate issues, other than needing to add a few exports commands due to the default exported modules. I did try using alpine-3.6 as well, but unfortunately a non passive change was introduced when upgrading busy box that no longer recognizes non-POSIX environment variables.

gliderlabs/docker-alpine#290

FROM alpine:3.5

ENV JAVA_HOME=/opt/jdk \
    PATH=${PATH}:/opt/jdk/bin \
    LANG=C.UTF-8

RUN set -ex && \
    apk add --no-cache bash && \
    wget http://download.java.net/java/jdk9-alpine/archive/179/binaries/jdk-9-ea+179_linux-x64-musl_bin.tar.gz -O jdk.tar.gz && \
    mkdir -p /opt/jdk && \
    tar zxvf jdk.tar.gz -C /opt/jdk --strip-components=1 && \
    rm jdk.tar.gz && \
    rm /opt/jdk/lib/src.zip
@xingxiuyi

This comment has been minimized.

Show comment
Hide comment
@xingxiuyi

xingxiuyi Oct 1, 2017

JDK9 has musl version.

download serverjre-9-ea+181_linux-x64-musl_bin.tar.gz from jdk.java.net

java -version:

java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+181-alpine-nightly-h6744-20170807)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+181-alpine-nightly-h6744-20170807, mixed mode)

xingxiuyi commented Oct 1, 2017

JDK9 has musl version.

download serverjre-9-ea+181_linux-x64-musl_bin.tar.gz from jdk.java.net

java -version:

java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+181-alpine-nightly-h6744-20170807)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+181-alpine-nightly-h6744-20170807, mixed mode)

@clehene

This comment has been minimized.

Show comment
Hide comment
@clehene

clehene Oct 4, 2017

I've adapted the current Docker but there's more work needed for a good setup.
I worked through:

  • Alpine JDK build
  • Locale
  • DNS caching
  • JCE / crypto (not necessary anymore)
  • nsswitch

I have the cli history, but it includes all the failed attempts too.

Questions:

  • Not clear how musl changes things - I'm guessing some things may require glibc?
  • Not yet clear how the modularized JDK aspect would come into play yet.

Related stuff:
https://blogs.oracle.com/developers/official-docker-image-for-oracle-java-and-the-openjdk-roadmap-for-containers

clehene commented Oct 4, 2017

I've adapted the current Docker but there's more work needed for a good setup.
I worked through:

  • Alpine JDK build
  • Locale
  • DNS caching
  • JCE / crypto (not necessary anymore)
  • nsswitch

I have the cli history, but it includes all the failed attempts too.

Questions:

  • Not clear how musl changes things - I'm guessing some things may require glibc?
  • Not yet clear how the modularized JDK aspect would come into play yet.

Related stuff:
https://blogs.oracle.com/developers/official-docker-image-for-oracle-java-and-the-openjdk-roadmap-for-containers

@rvillane

This comment has been minimized.

Show comment
Hide comment
@rvillane

rvillane commented Nov 16, 2017

+1

@bastelfreak

This comment has been minimized.

Show comment
Hide comment
@bastelfreak

bastelfreak Nov 26, 2017

Hi people, I would love to see an alpine image with java9. Was there any progress in the past month? Can we help somehow?

bastelfreak commented Nov 26, 2017

Hi people, I would love to see an alpine image with java9. Was there any progress in the past month? Can we help somehow?

@sabareeshkkanan

This comment has been minimized.

Show comment
Hide comment
@sabareeshkkanan

sabareeshkkanan Nov 26, 2017

you can try to build using this early access http://jdk.java.net/9/ea

sabareeshkkanan commented Nov 26, 2017

you can try to build using this early access http://jdk.java.net/9/ea

@anapsix

This comment has been minimized.

Show comment
Hide comment
@anapsix

anapsix Dec 11, 2017

Owner

added MUSL anapsix/alpine-java:9 and anapsix/alpine-java:9_jdk image tags (see java9 branch)

Owner

anapsix commented Dec 11, 2017

added MUSL anapsix/alpine-java:9 and anapsix/alpine-java:9_jdk image tags (see java9 branch)

@nlepage nlepage referenced this issue Dec 19, 2017

Closed

Add jdk10 #1

@Sineaggi

This comment has been minimized.

Show comment
Hide comment
@Sineaggi

Sineaggi Jan 9, 2018

@anapsix I appreciate the branch as well as the updated images, but I believe you've mixed up the jdk_9 and 9 builds, the 9 are the ones with the jdk and jdk_9 is just the jre 😄

Sineaggi commented Jan 9, 2018

@anapsix I appreciate the branch as well as the updated images, but I believe you've mixed up the jdk_9 and 9 builds, the 9 are the ones with the jdk and jdk_9 is just the jre 😄

@anapsix

This comment has been minimized.

Show comment
Hide comment
@anapsix

anapsix Jan 12, 2018

Owner

@Sineaggi yeup.. thx, fixed

Owner

anapsix commented Jan 12, 2018

@Sineaggi yeup.. thx, fixed

@mattnelson

This comment has been minimized.

Show comment
Hide comment
@mattnelson

mattnelson Apr 27, 2018

I did try using alpine-3.6 as well, but unfortunately a non passive change was introduced when upgrading busy box that no longer recognizes non-POSIX environment variables.

Found a work around for this issue. docker-library/openjdk#135 (comment)
Which worked nicely since bash is already provided by this image.

# Use a bash shell instead of the default sh shell to support non-POSIX environment variables
ENTRYPOINT ["/bin/bash", "-c", "java $JAVA_OPTS -jar myservice.jar"]

mattnelson commented Apr 27, 2018

I did try using alpine-3.6 as well, but unfortunately a non passive change was introduced when upgrading busy box that no longer recognizes non-POSIX environment variables.

Found a work around for this issue. docker-library/openjdk#135 (comment)
Which worked nicely since bash is already provided by this image.

# Use a bash shell instead of the default sh shell to support non-POSIX environment variables
ENTRYPOINT ["/bin/bash", "-c", "java $JAVA_OPTS -jar myservice.jar"]
@mattnelson

This comment has been minimized.

Show comment
Hide comment
@mattnelson

mattnelson Apr 27, 2018

Also looks like the 9-musl image is no longer buildable, until portola is GA is may be difficult to keep up as the only musl download currently available is for 11.

wget http://download.java.net/java/jdk9-alpine/archive/181/binaries/serverjre-9-ea+181_linux-x64-musl_bin.sha256
--2018-04-27 13:02:34--  http://download.java.net/java/jdk9-alpine/archive/181/binaries/serverjre-9-ea+181_linux-x64-musl_bin.sha256
Resolving download.java.net (download.java.net)... 23.40.20.195
Connecting to download.java.net (download.java.net)|23.40.20.195|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://download.java.net/java/jdk9-alpine/archive/181/binaries/serverjre-9-ea+181_linux-x64-musl_bin.sha256 [following]
--2018-04-27 13:02:34--  https://download.java.net/java/jdk9-alpine/archive/181/binaries/serverjre-9-ea+181_linux-x64-musl_bin.sha256
Connecting to download.java.net (download.java.net)|23.40.20.195|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-04-27 13:02:35 ERROR 404: Not Found.

mattnelson commented Apr 27, 2018

Also looks like the 9-musl image is no longer buildable, until portola is GA is may be difficult to keep up as the only musl download currently available is for 11.

wget http://download.java.net/java/jdk9-alpine/archive/181/binaries/serverjre-9-ea+181_linux-x64-musl_bin.sha256
--2018-04-27 13:02:34--  http://download.java.net/java/jdk9-alpine/archive/181/binaries/serverjre-9-ea+181_linux-x64-musl_bin.sha256
Resolving download.java.net (download.java.net)... 23.40.20.195
Connecting to download.java.net (download.java.net)|23.40.20.195|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://download.java.net/java/jdk9-alpine/archive/181/binaries/serverjre-9-ea+181_linux-x64-musl_bin.sha256 [following]
--2018-04-27 13:02:34--  https://download.java.net/java/jdk9-alpine/archive/181/binaries/serverjre-9-ea+181_linux-x64-musl_bin.sha256
Connecting to download.java.net (download.java.net)|23.40.20.195|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-04-27 13:02:35 ERROR 404: Not Found.
@Sineaggi

This comment has been minimized.

Show comment
Hide comment
@Sineaggi

Sineaggi Apr 27, 2018

jdk10 has been released, but there haven't been any musl builds for alpine linux. http://www.oracle.com/technetwork/java/javase/downloads/jdk10-downloads-4416644.html
However, jdk11 has alpine linux builds with musl support. http://jdk.java.net/11/
EDIT: these are jdk11 early-access builds.

Sineaggi commented Apr 27, 2018

jdk10 has been released, but there haven't been any musl builds for alpine linux. http://www.oracle.com/technetwork/java/javase/downloads/jdk10-downloads-4416644.html
However, jdk11 has alpine linux builds with musl support. http://jdk.java.net/11/
EDIT: these are jdk11 early-access builds.

@anapsix

This comment has been minimized.

Show comment
Hide comment
@anapsix

anapsix Apr 27, 2018

Owner

Perhaps, the route to take with Java 9, 10, and 11 is to go with glibc versions for a while

Owner

anapsix commented Apr 27, 2018

Perhaps, the route to take with Java 9, 10, and 11 is to go with glibc versions for a while

@mattnelson

This comment has been minimized.

Show comment
Hide comment
@mattnelson

mattnelson May 1, 2018

Perhaps, the route to take with Java 9, 10, and 11 is to go with glibc versions for a while

I agree. Would still like to have additional musl images available for those that want to experiment.

mattnelson commented May 1, 2018

Perhaps, the route to take with Java 9, 10, and 11 is to go with glibc versions for a while

I agree. Would still like to have additional musl images available for those that want to experiment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment