commit 911611acacdfe84e0d658096fc4717041e792614 Author: Luca Milanesio Date: Tue Oct 6 14:49:01 2020 +0100 Update dev-{eclipse,intellij} development for Java 11 Update references in the development documentation for Eclipse and IntelliJ by mentioning that Java 11 is the default. Provide a workaround for still using Java 8 for the Eclipse-based development. Change-Id: I85e6d025df714b435edad58d14f71d2d9d5c0f56 diff --git a/Documentation/dev-eclipse.txt b/Documentation/dev-eclipse.txt index 742cf42..bbe227a 100644 --- a/Documentation/dev-eclipse.txt +++ b/Documentation/dev-eclipse.txt @@ -4,7 +4,8 @@ This document is about configuring Gerrit Code Review into an Eclipse workspace for development. -Java 8 or later SDK is required. +Java 11 or later SDK is required. +Otherwise, java 8 can still be used for now as described below. [[setup]] == Project Setup @@ -30,6 +31,10 @@ and ---- First, generate the Eclipse project by running the `tools/eclipse/project.py` script. +If running Eclipse on Java 8, add the extra parameter +`-e='--java_toolchain=//tools:error_prone_warnings_toolchain'` +for generating a compatible project. + Then, in Eclipse, choose 'Import existing project' and select the `gerrit` project from the current working directory. @@ -79,15 +84,16 @@ the same way you would when link:dev-build-plugins.html#_bundle_custom_plugin_in_release_war[bundling in release.war] and run `tools/eclipse/project.py`. -[[Newer Java versions]] +== Java Versions -Java 9 and later are supported, but some adjustments must be done, because -Java 8 is still the default: +Java 11 is supported as a default, but some adjustments must be done for other JDKs: * Add JRE, e.g.: directory: /usr/lib64/jvm/java-9-openjdk, name: java-9-openjdk-9 * Change execution environment for gerrit project to: JavaSE-9 (java-9-openjdk-9) * Check that compiler compliance level in gerrit project is set to: 9 +Moreover, the actual java 11 language features are not supported yet. + [[Formatting]] == Code Formatter Settings diff --git a/Documentation/dev-intellij.txt b/Documentation/dev-intellij.txt index b67d546..149b14a 100644 --- a/Documentation/dev-intellij.txt +++ b/Documentation/dev-intellij.txt @@ -9,7 +9,7 @@ Bazel must be installed as described by <>. It's strongly recommended to verify you can build your Gerrit tree with Bazel -for Java 8 from the command line first. Ensure that at least +for Java 11 from the command line first. Ensure that at least `bazel build gerrit` runs successfully before you proceed. === IntelliJ version and Bazel plugin @@ -21,12 +21,12 @@ to see what version of the IntelliJ IDEA it is actually compatible with. Also note that the version of the Bazel plugin used in turn may or may not be compatible with the Bazel version used. -In addition, Java 8 must be specified on your path or via `JAVA_HOME` so that +In addition, Java 11 must be specified on your path or via `JAVA_HOME` so that building with Bazel via the Bazel plugin is possible. TIP: If the synchronization of the project with the BUILD files using the Bazel plugin fails and IntelliJ reports the error **Could not get Bazel roots**, this -indicates that the Bazel plugin couldn't find Java 8. +indicates that the Bazel plugin couldn't find Java 11. === Installation of IntelliJ IDEA