Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 929c650

Browse files
committed
Add note about JDK9
1 parent 8409fc6 commit 929c650

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

developer-tools/java/chapters/ch03-build-image.adoc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,27 @@ busybox latest 54511612f1c4 9 days ago
115115

116116
=== Create a simple Java application
117117

118+
[NOTE]
119+
====
120+
If you are running OpenJDK 9, `mvn package` may http://openjdk.java.net/jeps/182[fail] with
121+
[source, text]
122+
----
123+
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project helloworld: Compilation failure: Compilation failure:
124+
[ERROR] Source option 1.5 is no longer supported. Use 1.6 or later.
125+
[ERROR] Target option 1.5 is no longer supported. Use 1.6 or later.
126+
----
127+
128+
You can add
129+
[source, xml]
130+
----
131+
<properties>
132+
<maven.compiler.source>1.6</maven.compiler.source>
133+
<maven.compiler.target>1.6</maven.compiler.target>
134+
</properties>
135+
----
136+
to the generated `pom.xml` to target 1.6 instead. See also the link:chapters/ch03-build-image-java-9.adoc[Build a Docker Image for Java 9] chapter.
137+
====
138+
118139
Create a new Java project:
119140

120141
[source, text]

0 commit comments

Comments
 (0)