brentwritescode opened a new issue #1319:
URL: https://github.com/apache/helix/issues/1319


   ### Describe the bug
   The documentation for building Apache Helix on 
https://helix.apache.org/1.0.1-docs/Building.html and https://helix.apache.org/ 
states that Apache Helix is compatible with JDK 1.8+, Maven 3.5.0+, but the 
build fails with Java 11 with the following error:
   
   ```
   %> sudo mvn install package -DskipTests
   [INFO] BUILD FAILURE
   [INFO] 
------------------------------------------------------------------------
   [INFO] Total time:  01:06 min
   [INFO] Finished at: 2020-08-12T21:42:06Z
   [INFO] 
------------------------------------------------------------------------
   [ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) 
on project zookeeper-api: Compilation failure: Compilation failure:
   [ERROR] 
/home/brent/helix/zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkServer.java:[23,23]
 error: package javax.annotation does not exist
   [ERROR] 
/home/brent/helix/zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkServer.java:[24,23]
 error: package javax.annotation does not exist
   [ERROR] 
/home/brent/helix/zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkServer.java:[79,5]
 error: cannot find symbol
   [ERROR]   symbol:   class PostConstruct
   [ERROR]   location: class ZkServer
   [ERROR] 
/home/brent/helix/zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkServer.java:[148,5]
 error: cannot find symbol
   [ERROR] -> [Help 1]
   [ERROR]
   [ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
   [ERROR] Re-run Maven using the -X switch to enable full debug logging.
   [ERROR]
   [ERROR] For more information about the errors and possible solutions, please 
read the following articles:
   [ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
   [ERROR]
   [ERROR] After correcting the problems, you can resume the build with the 
command
   [ERROR]   mvn <goals> -rf :zookeeper-api
   ```
   
   ### To Reproduce
   
   Run `sudo mvn install package -DskipTests` with Java 11 as the default JDK.
   
   ### Expected behavior
   One of two things:
   
   1. Apache Helix successfully builds with Java 11
   
   OR
   
   2.  The documentation is updated to indicate that Java 11 (and beyond) are 
not currently supported
   
   ### Additional context
   
   The issue stems from the fact that, as of Java 11, some legacy J2EE-related 
packages such as javax.annotation.* and javax.xml.bind.* have been removed from 
the JDK, but the `helix/zookeeper-api` and `helix-core` sub-builds of the 
project still require these libraries.
   
   The issue can be fixed for Java 11 by adding the following dependency to 
`helix/zookeeper-api/pom.xml`:
   
   ```
   <dependency>
     <groupId>javax.annotation</groupId>
     <artifactId>javax.annotation-api</artifactId>
     <version>1.3.2</version>
   </dependency>
   ```
   
   And by adding the following dependency to `helix/helix-core/pom.xml`:
   
   ```
   <dependency>
     <groupId>javax.xml.bind</groupId>
     <artifactId>jaxb-api</artifactId>
     <version>2.1</version>
   </dependency>
   ```
   
   Those two additions re-add the packages that have been removed from Java 11 
and allow the build to complete successfully.
   
   I understand that claiming full Java 11 support is a large undertaking, so 
if Java 11 and beyond are not officially supported, it would be great if the 
corresponding documentation on pages like https://helix.apache.org/ and 
https://helix.apache.org/1.0.1-docs/Building.html could be clear about 
indicating this.
   
   Unfortunately for me, Java 11 was the default on my OS (Ubuntu 18.04) and I 
lost a few hours tracking this down.  My hope is that we can save some other 
developers from chasing down the same issue.  I'd be happy to submit a pull 
request if that would be helpful, just let me know.  Thank you!


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to