各位好,我在写一个hadoop程序,要解析ip,用的纯真数据库
但是,运行的时候,报错,找不到qqwry.bat文件
代码如下
try {
String ipFilePath = IPSeeker.class.getResource("/qqwry.dat").getFile();
ipFile = new RandomAccessFile(ipFilePath, "r");
} catch (FileNotFoundException e) {
System.out.println("IP地址信息文件没有找到,IP显示功能将无法使用");
ipFile = null;
}
我把文件放在src/main/resources下,或者单独建立一个config文件夹存放,通过maven打包后,反编译都可以看到根目录下有这个文件,但是运行的时候,就是报错没找到
各位大神,有知道怎么回事的吗?