title: How do I get 'import java.net.*' to work?
body: <p>I am learning to program in java. I have programmed in other languages. I have tried import java.net.*; at the start of my code file. But it ghosts out. I have looked in my External Libraries directory and it is not there. I found that java.net was deprecated in 201x &lt;-- some recent year. I am using jdk 10. I am using IntelliJ IDE. I have gotten some import statements to work.</p>
  
  <p>I saw on github that they took over hosting oracle classes that were deprecated at Oracle. </p>
  
  <p>I know I have to use the classpath command if I put the .jar or the .zip file containing the class in another directory. I have searched my laptop and i don't have any other .jar or .zip files other than specific other programs I have installed which also don't contain the java.net class (e.g. Aptana Studio 3)</p>
  
  <p>I am using Mac with OS Sierra.</p>
  
  <pre><code>package com.robinhoodcomputer.myfirstprojects;
  
  import java.io.FileReader;  &lt;&lt;-- these import ok
  import java.io.*;
  
  
  import java.net.*;             &lt;&lt;--- these don't import
  import java.net.ServerSocket;
  import java.net.Socket;
  import java.util.Date;
  
  
  public class Myreader {
  public static void main(String[] args) throws Exception {
      int intVal;
      char myChar;
      String st;
      File file = new File("/java/file");
      BufferedReader br = new BufferedReader(new FileReader(file));
      // FileReader fr = new 
      FileReader("/java/HelloWorld/resources/file.txt");
  
  while ((intVal = br.read()) != -1) {
      myChar = (char) intVal;
      System.out.print(myChar);
      }
  myHostName = getLocalHost(); &lt;&lt;-- this doesn't show being available
  }
  }
  </code></pre>
  
  <p>I have searched and cannot find any articles that actually do anything but explain how to connect to the class file and that you have to import it in your code. No one talks about getting the java.net class itself.
  I found one reference to jdk.net in an oracle jdk 10 API specification page.</p>
  
  <p>What am I suppose to use to get the IP address using a hostname in java these days??</p>
  
  <p>thx</p>
  
  <p>P.S. I know this code really doesn't have anything to do with networking, most of it is just reading a file and displaying what's in the file. I wanted to use this code file just to try getting an IP address also.  My question is mainly just about making the import statement to work. thx</p>