cushon commented on code in PR #23771:
URL: https://github.com/apache/beam/pull/23771#discussion_r1002256119
##########
sdks/java/container/agent/build.gradle:
##########
@@ -59,6 +59,7 @@ if (project.hasProperty('java11Home')) {
project.tasks.each {
it.onlyIf {
project.hasProperty('java11Home') || project.hasProperty('java17Home')
- || JavaVersion.VERSION_1_8.compareTo(JavaVersion.current()) < 0
+ || (JavaVersion.VERSION_1_8.compareTo(JavaVersion.current()) < 0
+ &&
JavaVersion.VERSION_1_8.compareTo(JavaVersion.toVersion(project.javaVersion)) <
0)
Review Comment:
Without that, we end up trying to compile this with `--release 8` when
running on JDK 11, and it fails because it references Java 11-only APIs like
`Module`:
```
JAVA_HOME=${JAVA11_HOME?} ./gradlew compileJava
...
> Task :sdks:java:container:agent:compileJava FAILED
/usr/local/google/home/cushon/src/beam/sdks/java/container/agent/src/main/java/org/apache/beam/agent/OpenModuleAgent.java:33:
error: cannot find symbol
Set<Module> modulesToOpen = new HashSet<>();
^
symbol: class Module
location: class OpenModuleAgent
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]