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

Use OpenJDK 11 as default JDK #846

Merged
merged 9 commits into from
Feb 21, 2019
Merged

Use OpenJDK 11 as default JDK #846

merged 9 commits into from
Feb 21, 2019

Conversation

sstone
Copy link
Member

@sstone sstone commented Jan 31, 2019

This PR addresses 2 different issues:

  • a license policy change for Oracle's JDK8: can we still recommend it as default ?
  • a more general maintenance issue: should we switch to more recent versions of the JDK ?

From a licensing point of view: using Oracles JDK8 is fine for personal use but not for commercial use, and switching OpenJDK8 is not seamless because of JavaFX.

Oracle will provide public updates of Oracle JDK 8 through at least December 2020 for personal desktop use and January 2019 for commercial use. After that, users can either go onto a paid support plan or use a Java SE 8 / OpenJDK 8 binary distribution from another provider.
You can continue to use Oracle JDK 8 indefinitely without updates.

We could recommend that users install OpenJDK 8, but it is not functionally identical to Oracle's JDK 8 and for example does not include JavaFX which is a problem for GUI users.

See also https://blog.jetbrains.com/idea/2018/09/using-java-11-in-production-important-things-to-know/

From a maintenance point of view: switching to JDK11 makes more sense

Since Java11, Oracle's commercial JDK and Oracle's OpenJDK are functionally the same. JavaFX is now a "clean" separate package, which can be added as a dependency when building the app (which is done in this PR, user's don't have to worry about installing/compiling it).
Java 11 is also a LTS (see Java Support Roadmap), 9 and 10 were not.
For Scala development, it is actually recommended to target JDK11 and not 9 or 10, see Scala JDK compatibility overview

Although the table above jumps from 8 to 11, JDK 9 and 10 will probably also work wherever 11 does. But unlike 9 and 10, 11 is an LTS release, so 11 is what we actually test on and recommend.

This PR:

  • Switches to OpenJDK 11 as our recommended default JDK instead of Oracle JDK8
  • Upgrades to Scala 2.11.12 which is compatible with JDK11
  • Add JavaFX to our dependencies: users don't need to install JavaFX separately to run and build our GUI
  • remove the .exe installer for Windows. Installation on Windows is now the same as Linux/Oxs: install Java, and run eclair with java -jar

sstone and others added 3 commits January 30, 2019 17:35
Eclair can be built and used on Oracle JDK 1.8 or OpenJDK 11.
JavaFX is now embedded in eclair-node-gui and does not need to be installed separately.

Limitation: the Splash Screen has been removed from the GUI.
@dpad85
Copy link
Member

dpad85 commented Feb 19, 2019

Note that running the Jar with OpenJDK 11 will raise the following warning:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by Capsule (file: ...xxx.jar) to field com.sun.jmx.mbeanserver.JmxMBeanServer.mbsInterceptor
WARNING: Please consider reporting this to the maintainers of Capsule
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

AFAICT this is a bit ugly but otherwise has no incidence.

@sstone
Copy link
Member Author

sstone commented Feb 20, 2019

The capsule issue is known (puniverse/capsule#110). It is indeed ugly but "just" a warning.
We could also create a .zip file with all dependencies and add a command line that adds them all to the classpath, either manually with the assembly plugin or with the "trampoline' option in capsule. No more warnings, but we end up with a command line to launch eclair that looks like:

"/home/fabrice/OpenJDK/jdk-11.0.2/bin/java" "-Djava.library.path=/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0" "-Dcapsule.app=eclair-node-gui-0.2-SNAPSHOT-f77f8c0" "-Dcapsule.dir=/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0" "-Dcapsule.jar=/home/fabrice/code/eclair/eclair-node-gui/target/eclair-node-gui-0.2-SNAPSHOT-f77f8c0.tx" "-classpath" "/home/fabrice/code/eclair/eclair-node-gui/target/eclair-node-gui-0.2-SNAPSHOT-f77f8c0.tx:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/eclair-node-gui_2.11-0.2-SNAPSHOT.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/akka-parsing_2.11-10.0.11.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/javafx-fxml-11.0.2.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/javafx-controls-11.0.2-linux.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/scodec-core_2.11-1.11.2.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/macro-compat_2.11-1.1.1.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/animal-sniffer-annotations-1.14.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/core-3.3.0.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/ssl-config-core_2.11-0.2.1.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/paranamer-2.8.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/core_2.11-1.3.9.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/eclair-node_2.11-0.2-SNAPSHOT.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/akka-http-core_2.11-10.0.11.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/json4s-core_2.11-3.6.0.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/scala-collection-compat_2.11-0.2.1.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/akka-stream_2.11-2.4.20.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/eclair-core_2.11-0.2-SNAPSHOT.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/janino-3.0.7.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/javafx-graphics-11.0.2.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/jheaps-0.9.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/sqlite-jdbc-3.21.0.1.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/logback-classic-1.2.3.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/config-1.3.0.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/okio-1.14.0.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/jackson-annotations-2.9.0.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/jeromq-0.4.0.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/commons-codec-1.9.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/grizzled-slf4j_2.11-1.3.1.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/javafx-graphics-11.0.2-linux.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/guava-24.0-android.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/okhttp-3.11.0.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/bitcoin-lib_2.11-0.9.19.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/jsr305-3.0.2.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/json4s-scalap_2.11-3.6.0.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/shapeless_2.11-2.3.3.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/scala-java8-compat_2.11-0.7.0.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/checker-compat-qual-2.0.0.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/json4s_2.11-1.3.9.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/scala-library-2.11.12.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/j2objc-annotations-1.1.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/commons-compiler-3.0.7.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/okhttp-backend_2.11-1.3.9.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/netty-all-4.1.32.Final.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/javafx-base-11.0.2.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/json4s-jackson_2.11-3.6.0.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/scodec-bits_2.11-1.1.9.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/logback-core-1.2.3.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/jackson-databind-2.9.6.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/scala-parser-combinators_2.11-1.0.4.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/akka-http-json4s_2.11-1.19.0.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/javafx-controls-11.0.2.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/error_prone_annotations-2.1.3.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/jackson-core-2.9.6.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/akka-http_2.11-10.0.11.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/reactive-streams-1.0.0.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/javafx-base-11.0.2-linux.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/core-1.58.0.0.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/slf4j-api-1.7.25.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/json4s-ast_2.11-3.6.0.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/akka-slf4j_2.11-2.4.20.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/akka-actor_2.11-2.4.20.jar:/home/fabrice/.capsule/apps/eclair-node-gui-0.2-SNAPSHOT-f77f8c0/javafx-fxml-11.0.2-linux.jar" "fr.acinq.eclair.JavafxBoot"

which is arguable worse than the warnings we get with our current packaging.

@sstone sstone changed the title [WIP] Use OpenJDK 11 as default JDK Use OpenJDK 11 as default JDK Feb 20, 2019
@sstone sstone requested review from pm47 and dpad85 February 20, 2019 10:50
Copy link
Member

@pm47 pm47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Capsule warnings are annoying but are fine for the time being, we will need to find a packaging solution eventually.

README.md Outdated
You need to first install java, more precisely a [JRE 1.8](http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html).

:warning: If you are using the OpenJDK JRE, you will need to build OpenJFX yourself, or run the application in headless mode (see below).
You need to first install java. Eclair will run on [Oracle JRE 1.8](http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html), [Oracle JDK 11](https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html) and [Open JDK 11](https://jdk.java.net/11/).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's be more clear:

"You need to install Open JDK 11".... and then.... "Eclair will also run on X Y Z but this is not recommended.

README.md Outdated

:warning: If you are using the OpenJDK JRE, you will need to build OpenJFX yourself, or run the application in headless mode (see below).
You need to first install java. Eclair will run on [Oracle JRE 1.8](http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html), [Oracle JDK 11](https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html) and [Open JDK 11](https://jdk.java.net/11/).
We recommend that use use [Open JDK 11](https://jdk.java.net/11/).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Suggested change
We recommend that use use [Open JDK 11](https://jdk.java.net/11/).
We recommend that you use [Open JDK 11](https://jdk.java.net/11/).

@@ -235,6 +235,12 @@
<version>0.9.8</version>
<scope>test</scope>
</dependency>
<dependency>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this?

Copy link
Member Author

@sstone sstone Feb 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this for our docker tests, I've added a comment in the pom

@@ -127,6 +127,7 @@
<arg>-unchecked</arg>
<arg>-Xmax-classfile-name</arg>
<arg>140</arg>
<arg>-nobootcp</arg>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this do?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removes the scala jar from the boot classpath and is need to compile scala code on JDK9+

BUILD.md Outdated
@@ -1,11 +1,13 @@
# Building Eclair

## Requirements
- [Java Development Kit](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) 1.8u161 or newer
- [Oracle JDK 1.8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) 1.8u161 or newer, or [OpenJDK 11](https://jdk.java.net/11/).
- [Maven](https://maven.apache.org/download.cgi) 3.5.4 or newer
- [Inno Setup](http://www.jrsoftware.org/isdl.php) 5.5.9 (optional, if you want to generate the windows installer)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inno Setup and the rest of the related build instructions should be removed.

@sstone sstone merged commit 34e51c1 into master Feb 21, 2019
@sstone sstone deleted the use-jdk11 branch February 21, 2019 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants