title: InetAddress cannot be resolved to a type
body: <p>I'm using the following code to check if the provided ip is reachable in java.</p>
  
  <pre><code>public String isNetworkReachable(){
          int timeout = 2000;
          String status = "SUCCESS";
          try {
              InetAddress address = InetAddress.getByAddress("10.2.240.74".getBytes());
  
              if(!address.isReachable(timeout)){
                  status = "ERROR";
              }
  
          } catch (UnknownHostException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
  
          return status;
  
      }
  </code></pre>
  
  <p>WhenI run the code, I get an error saying </p>
  
  <pre><code>java.lang.Error: Unresolved compilation problems: 
  InetAddress cannot be resolved to a type
  InetAddress cannot be resolved
  InetAddress cannot be resolved to a type
  
  at com.jkcs.touchpos.sync.SyncUtil.synchronzeManually(SyncUtil.java:83)
  at com.jkcs.touchpos.sync.SyncUtil$$FastClassByCGLIB$$6e1c4a07.invoke(&lt;generated&gt;)
  at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
  at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
  at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
  at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
  at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631)
  at com.jkcs.touchpos.sync.SyncUtil$$EnhancerByCGLIB$$f7d7791c.synchronzeManually(&lt;generated&gt;)
  at com.jkcs.touchpos.application.controller.TouchPosWebServiceController.syncStatus(TouchPosWebServiceController.java:864)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
  at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
  at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
  at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
  at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)
  at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920)
  at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:816)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
  at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
  at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:530)
  at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:426)
  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:118)
  at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:495)
  at org.eclipse.jetty.server.session.SessionHandler.handle(SessionHandler.java:179)
  at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:930)
  at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:361)
  at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:864)
  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:116)
  at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:243)
  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:112)
  at org.eclipse.jetty.server.Server.handle(Server.java:337)
  at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:552)
  at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:979)
  at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:533)
  at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:203)
  at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:399)
  at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:437)
  at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:435)
  at java.lang.Thread.run(Thread.java:662)
  </code></pre>
  
  <p>What have I done wrong here. Please help! </p>