Fixing benchmarks build on non-linux systems.
diff --git a/benchmarks/build.gradle b/benchmarks/build.gradle
index 1d95418..478750b 100644
--- a/benchmarks/build.gradle
+++ b/benchmarks/build.gradle
@@ -32,16 +32,20 @@
 }
 
 dependencies {
-    compile project(':grpc-core'),
-            project(':grpc-netty'),
-            project(':grpc-okhttp'),
-            project(':grpc-stub'),
-            project(':grpc-integration-testing'),
-            libraries.junit,
-            libraries.mockito,
-            libraries.hdrhistogram,
-            libraries.netty_tcnative,
-            libraries.netty_transport_native_epoll
+    List deps = [project(':grpc-core'),
+                 project(':grpc-netty'),
+                 project(':grpc-okhttp'),
+                 project(':grpc-stub'),
+                 project(':grpc-integration-testing'),
+                 libraries.junit,
+                 libraries.mockito,
+                 libraries.hdrhistogram]
+    if (osdetector.os == "linux") {
+        // These are only available on linux.
+        deps += [libraries.netty_tcnative, libraries.netty_transport_native_epoll]
+    }
+
+    compile deps
 
     alpnboot alpnboot_package_name
 }
diff --git a/benchmarks/src/main/java/io/grpc/benchmarks/qps/AsyncClient.java b/benchmarks/src/main/java/io/grpc/benchmarks/qps/AsyncClient.java
index c8634ff..a8e4e2c 100644
--- a/benchmarks/src/main/java/io/grpc/benchmarks/qps/AsyncClient.java
+++ b/benchmarks/src/main/java/io/grpc/benchmarks/qps/AsyncClient.java
@@ -72,8 +72,6 @@
 import io.grpc.transport.netty.NettyChannelBuilder;
 import io.grpc.transport.okhttp.OkHttpChannelBuilder;
 import io.netty.channel.EventLoopGroup;
-import io.netty.channel.epoll.EpollEventLoopGroup;
-import io.netty.channel.epoll.EpollSocketChannel;
 import io.netty.channel.nio.NioEventLoopGroup;
 import io.netty.channel.socket.nio.NioSocketChannel;
 import io.netty.handler.ssl.SslContext;
@@ -201,8 +199,18 @@
     final EventLoopGroup group;
     final Class<? extends io.netty.channel.Channel> channelType;
     if (config.nettyNativeTransport) {
-      group = new EpollEventLoopGroup();
-      channelType = EpollSocketChannel.class;
+      try {
+        // These classes are only available on linux.
+        Class<?> groupClass = Class.forName("io.netty.channel.epoll.EpollEventLoopGroup");
+        @SuppressWarnings("unchecked")
+        Class<? extends io.netty.channel.Channel> channelClass =
+                (Class<? extends io.netty.channel.Channel>) Class.forName(
+                        "io.netty.channel.epoll.EpollSocketChannel");
+        group = (EventLoopGroup) groupClass.newInstance();
+        channelType = channelClass;
+      } catch (Exception e) {
+        throw new RuntimeException(e);
+      }
     } else {
       group = new NioEventLoopGroup();
       channelType = NioSocketChannel.class;
diff --git a/benchmarks/src/main/java/io/grpc/benchmarks/qps/AsyncServer.java b/benchmarks/src/main/java/io/grpc/benchmarks/qps/AsyncServer.java
index 6207d8d..808a856 100644
--- a/benchmarks/src/main/java/io/grpc/benchmarks/qps/AsyncServer.java
+++ b/benchmarks/src/main/java/io/grpc/benchmarks/qps/AsyncServer.java
@@ -50,8 +50,6 @@
 import io.grpc.transport.netty.NettyServerBuilder;
 import io.netty.channel.EventLoopGroup;
 import io.netty.channel.ServerChannel;
-import io.netty.channel.epoll.EpollEventLoopGroup;
-import io.netty.channel.epoll.EpollServerSocketChannel;
 import io.netty.channel.nio.NioEventLoopGroup;
 import io.netty.channel.socket.nio.NioServerSocketChannel;
 import io.netty.handler.ssl.SslContext;
@@ -104,9 +102,18 @@
     final EventLoopGroup worker;
     final Class<? extends ServerChannel> channelType;
     if (nettyNativeTransport) {
-      boss = new EpollEventLoopGroup();
-      worker = new EpollEventLoopGroup();
-      channelType = EpollServerSocketChannel.class;
+      try {
+        // These classes are only available on linux.
+        Class<?> groupClass = Class.forName("io.netty.channel.epoll.EpollEventLoopGroup");
+        @SuppressWarnings("unchecked")
+        Class<? extends ServerChannel> channelClass = (Class<? extends ServerChannel>)
+                Class.forName("io.netty.channel.epoll.EpollServerSocketChannel");
+        boss = (EventLoopGroup) groupClass.newInstance();
+        worker = (EventLoopGroup) groupClass.newInstance();
+        channelType = channelClass;
+      } catch (Exception e) {
+        throw new RuntimeException(e);
+      }
     } else {
       boss = new NioEventLoopGroup();
       worker = new NioEventLoopGroup();