THRIFT-4766: Fix JDK11 build (#1723)

* [THRIFT-4766] Enable JDK9 build
* THRIFT-4766: build on bionic using native jdk (java-11-openjdk)
Change from headless to the normal JDK. Maybe the libasound is pulled
in transitively.

diff --git a/lib/java/gradle/environment.gradle b/lib/java/gradle/environment.gradle
index 9b7eb1e..45fa63a 100644
--- a/lib/java/gradle/environment.gradle
+++ b/lib/java/gradle/environment.gradle
@@ -48,6 +48,7 @@
 ext.slf4jVersion = property('slf4j.version')
 ext.junitVersion = property('junit.version')
 ext.mockitoVersion = property('mockito.version')
+ext.javaxAnnotationVersion = property('javax.annotation.version')
 
 // In this section you declare where to find the dependencies of your project
 repositories {
@@ -66,6 +67,7 @@
     compile "org.apache.httpcomponents:httpclient:${httpclientVersion}"
     compile "org.apache.httpcomponents:httpcore:${httpcoreVersion}"
     compile "javax.servlet:servlet-api:${servletVersion}"
+    compile "javax.annotation:javax.annotation-api:${javaxAnnotationVersion}"
 
     testCompile "junit:junit:${junitVersion}"
     testCompile "org.mockito:mockito-all:${mockitoVersion}"