title: Can't get Kerberos realm
body: <p>I am new to Kerberos/hive, want to connect hive (Kerberos implemented) using JDBC.</p>
  
  <pre><code>&gt; &gt; org.apache.hadoop.conf.Configuration conf = new
  &gt; &gt; org.apache.hadoop.conf.Configuration();
  &gt; &gt;             conf.set("hadoop.security.authentication", "Kerberos");
  &gt; &gt;             UserGroupInformation.setConfiguration(conf);
  &gt; &gt;             UserGroupInformation.loginUserFromKeytab("&lt;principal&gt;", "&lt;path to keytab file&gt;");
  &gt; &gt; 
  &gt; &gt; 
  &gt; &gt; Class.forName(Util.getConstantProperty("hive.class.name"));
  &gt; &gt; 
  &gt; &gt; log.info("Making connection with Hive DB"); hiveConn =
  &gt; &gt; DriverManager.getConnection("&lt;hive db url&gt;",,"hive.user","");
  </code></pre>
  
  <p>getting error:</p>
  
  <pre><code>2018-10-29 20:32:50 ERROR ConnectionHandler:80 - java.lang.IllegalArgumentException: Can't get Kerberos realm java.lang.IllegalArgumentException: Can't get Kerberos realm
          at org.apache.hadoop.security.HadoopKerberosName.setConfiguration(HadoopKerberosName.java:65)
          at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:263)
          at org.apache.hadoop.security.UserGroupInformation.setConfiguration(UserGroupInformation.java:299)
          at utils.ConnectionHandler.connectHiveDB(ConnectionHandler.java:58)
  </code></pre>