Repository: iluwatar/java-design-patterns
Issue: Java 9 support
Labels: info: needs splitting
resolution: won't fix

Java 9 general availability is just a few months away and we should start migrating the codebase to work on top of that. This is a huge issue and needs more discussion, planning and splitting.

Issue comments:
There is now branch called `java9` where we aim to make the project work with JDK9. Pull requests helping towards that goal will be gratefully accepted.
The Java 9 build fails with the following output: 
[build.txt](https://github.com/iluwatar/java-design-patterns/files/1272821/build.txt)

With skip tests the build fails with the following output:
[skiptests.txt](https://github.com/iluwatar/java-design-patterns/files/1272828/skiptests.txt)

List of changes for Java 9: https://docs.oracle.com/javase/9/whatsnew/toc.htm
The following commands install the Oracle's JDK9 EA on Ubuntu.

```
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java9-installer
```

I also had to edit .bashrc and set
`export JAVA_HOME=/usr/lib/jvm/java-9-oracle/`

After which Java version displays as follows
```
$ java -version
java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
```

Listing installed Java versions and selecting the default Java version
`sudo update-alternatives --config java`
I'll take a look at this issue
Ok @danielsiwiec 
@iluwatar the PR above makes `mvn test` pass. Tested with Java 9ea14-zulu
@iluwatar What else is needed for this issue to be resolved?
- We should switch to using JDK9 at some point. When is the proper time? Does Travis support it already? The Travis build file should be modified for this and `java9` branch merged to master.
- How do we utilize the new Java 9 features? Separate issues should be created.
Tried the branch with openjdk-9 but the build fails with
```
Unrecognized option: --add-modules
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
```
I hope this pom from my project can help you.

https://github.com/javatlacati/datastrructureskotlin/blob/Java9/pom.xml
@iluwatar There is a sample shared at [SO-46084751](https://stackoverflow.com/questions/46084751/how-to-express-dependency-in-maven-on-java-ee-features-for-transition-to-java-9/46086920#46086920) on how to use the `--add-modules` to compiler args with Maven. Still curious to know what modules are you actually adding explicitly? (Reason being, one could look at the [JEP-320](http://openjdk.java.net/jeps/320) and see if using those dependencies could be the ideal state that the application should move to.)
Plans shifter to Java 11 support https://github.com/iluwatar/java-design-patterns/wiki/16.-Java-11-Transition

Pull request review comments:

Patch that resolved the issue:
diff --git a/pom.xml b/pom.xml
index 5dfb1fff4376..eb3b68c498fb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,7 +38,7 @@
         <junit-vintage.version>${junit.version}.2</junit-vintage.version>
         <junit-platform.version>1.0.2</junit-platform.version>
         <sping-test-junit5.version>1.0.2</sping-test-junit5.version>
-        <compiler.version>3.0</compiler.version>
+        <compiler.version>3.8.0</compiler.version>
         <jacoco.version>0.7.2.201409121644</jacoco.version>
         <commons-dbcp.version>1.4</commons-dbcp.version>
         <camel.version>2.16.1</camel.version>
@@ -357,15 +357,14 @@
         </pluginManagement>
 
         <plugins>
-            <!-- Tell maven to compile using Java 8 -->
+            <!-- Tell maven to compile using Java 11 -->
             <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
+			    <groupId>org.apache.maven.plugins</groupId>
+			    <artifactId>maven-compiler-plugin</artifactId>
                 <version>${compiler.version}</version>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                </configuration>
+			    <configuration>
+			        <release>11</release>
+			    </configuration>            
             </plugin>
             <plugin>
                 <groupId>org.jacoco</groupId>
diff --git a/trampoline/pom.xml b/trampoline/pom.xml
index e6f2e620afac..1bd675c30576 100644
--- a/trampoline/pom.xml
+++ b/trampoline/pom.xml
@@ -51,7 +51,7 @@
         <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
-            <version>1.16.18</version>
+            <version>1.18.2</version>
         </dependency>
 
 


Test patch: