Exception in thread “main“ java.io.IOException: java.lang.reflect.InvocationTargetException

关于使用HBase-1.3.1版本 API  运行时出现  Exception in thread "main" java.io.IOException: java.lang.reflect.InvocationTargetException 异常的原因和解决方案


一 现象

Exception in thread “main“ java.io.IOException: java.lang.reflect.InvocationTargetException

二 原因 

HBase-1.3.1版本和JDK版本不匹配,可以使用JDK1.7或者JDK1.8

Exception in thread “main“ java.io.IOException: java.lang.reflect.InvocationTargetException 

三 解决办法:改JDK版本 

        (0)安装JDK1.8或者JDK1.7版本,要记得安装路径,等一下要用,比如我的安装路径是:

Exception in thread “main“ java.io.IOException: java.lang.reflect.InvocationTargetException

        (1)点击Window下的Preferences

Exception in thread “main“ java.io.IOException: java.lang.reflect.InvocationTargetException

        (2)添加JDK1.8或者JDK1.7的根目录

Exception in thread “main“ java.io.IOException: java.lang.reflect.InvocationTargetException

        (3)添加JDK1.8或者JDK1.7

              a)

Exception in thread “main“ java.io.IOException: java.lang.reflect.InvocationTargetException

               b) 点击Directory找到你刚刚JDK的安装目录

Exception in thread “main“ java.io.IOException: java.lang.reflect.InvocationTargetException

              c)上一步完整之后,点击Apply and Close

Exception in thread “main“ java.io.IOException: java.lang.reflect.InvocationTargetException

        (4)修改当前项目的jdk

              a)

Exception in thread “main“ java.io.IOException: java.lang.reflect.InvocationTargetException

              b) 

Exception in thread “main“ java.io.IOException: java.lang.reflect.InvocationTargetException

              c)

Exception in thread “main“ java.io.IOException: java.lang.reflect.InvocationTargetException 

              d)

Exception in thread “main“ java.io.IOException: java.lang.reflect.InvocationTargetException 

              e)选择JDK1.8或者JDK1.7

 Exception in thread “main“ java.io.IOException: java.lang.reflect.InvocationTargetException

              f)最后点击Apply and Close ,然后重新运行程序就没问题啦!!!