Skip to content
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

Get everything working with Java 9+ #262

Closed
GentlemanHal opened this issue Dec 24, 2018 · 8 comments
Closed

Get everything working with Java 9+ #262

GentlemanHal opened this issue Dec 24, 2018 · 8 comments
Labels
for developers Changes that make development easier improvement Changes that improve an existing feature
Milestone

Comments

@GentlemanHal
Copy link
Member

GentlemanHal commented Dec 24, 2018

My understanding is our server linting currently fails if you use a Java version greater than 8. It would be good to get this working so we can upgrade to using Java 11 in production.

@joejag Is linting the only issue?

Also Java 8 is no longer getting any public updates, https://www.oracle.com/technetwork/java/java-se-support-roadmap.html

Edit: Should we include a Java Version Manager like Jabba and recommend that to users in the wiki docs (like we do with nvm)?

@GentlemanHal GentlemanHal added improvement Changes that improve an existing feature for developers Changes that make development easier nevergreen.io Changes specifically related to nevergreen.io labels Dec 24, 2018
@joejag
Copy link
Contributor

joejag commented Dec 24, 2018

It's this line where we use an Integer constructor with a String that fails validation as it's deprecated: https://github.com/build-canaries/nevergreen/blob/master/src/nevergreen/config.clj#L28

We did have an issue where we accidentally used some Java9 features which didn't work in Java8. I think it was around the AES stuff. So we should probably keep targetting against Java8 runtime, but make it work with higher levels of Java.

The other issue is that Midje isn't supported with Java9, which will mean rewriting the tests.

GentlemanHal added a commit that referenced this issue Dec 28, 2018
The constructor is deprecated in new JDK versions
@GentlemanHal
Copy link
Member Author

I've fixed the deprecation issue with the linting as that was easy.

I've tried with Java 11 and all the midje tests passed, so maybe the issues have been fixed (but maybe only for 11)?

I used Jabba to easily switch JDKs but for some reason it doesn't have Oracle JDK9 or 10?

@GentlemanHal
Copy link
Member Author

GentlemanHal commented Dec 28, 2018

I found this article which is pretty informative:

https://www.deps.co/blog/how-to-upgrade-clojure-projects-to-use-java-11/

JDK 11 was released on September 25, 2018. JDK 11 is the first long term support release since JDK 8. Due to the short support lifespan of JDK 9 and 10 (six months each), and the number of breaking changes in those releases, many businesses and individuals have continued to use JDK 8.

Maybe this is why you can't install 9 or 10 via Jabba? This also implies we probably shouldn't bother testing with those versions and just test supporting 11?

@GentlemanHal
Copy link
Member Author

GentlemanHal commented Dec 28, 2018

It also seems getting a Alpine based Docker image for JDK11 might not be simple:

docker-library/openjdk#211

We might be able to use adoptopenjdk/openjdk11:alpine-slim

https://hub.docker.com/r/adoptopenjdk/openjdk11/tags

I've tested running a Docker image from adoptopenjdk/openjdk11:alpine-slim locally and everything seems to work. Jabba also allows you to install [email protected].

@GentlemanHal
Copy link
Member Author

Just remembered we don't actually use the Docker image on nevergreen.io so we'd need to update that separately, which I'm assuming we'd do manually for now?

How we originally installed via infra:

"sudo apt-get install haproxy default-jre -y" # need to make this explicit about java8

I'm assuming we got Java8 as it was the latest/default at the time.

@joejag
Copy link
Contributor

joejag commented Jan 3, 2019

I think this only affects development, but, yeah, let's forget 9 and 10 as they weren't proper releases. 8 and 11 we should support.

For the infra: we used the OS provided default via that line which was 8. Are we looking to upgrade to using 11 in production? It'll probably mean adding a yum repo to get it to work

@GentlemanHal
Copy link
Member Author

GentlemanHal commented Jan 5, 2019

I think it would be good to switch to 11 for prod and recommended people use it during development, but I guess it isn't required if it's difficult.

Edit: I don't mind opening a new issues for upgrading production and the docker image to Java 11. That would allow us to close this issue as I'm pretty sure everything should be working with newer version of Java now.

@GentlemanHal
Copy link
Member Author

I've opened #267 for updating the Docker image and build-canaries/nevergreen-infra#13 for updating production.

I'm going to close this for now, if it turns out we still have problems with newer JDKs we can open specific issues to fix those problems.

@GentlemanHal GentlemanHal removed the nevergreen.io Changes specifically related to nevergreen.io label Jan 22, 2019
@GentlemanHal GentlemanHal modified the milestones: v4.0.0, v3.2.0 Mar 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for developers Changes that make development easier improvement Changes that improve an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants