Exception in thread "main" java.lang.NullPointerException报错怎么解决
package bean;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.json.JSONException;
import org.json.JSONObject;
public class ReadJson {
public static void main(String[] args) throws IOException, JSONException{
File fi = new File(ReadJson.class.getResource("/wangxiaoer.json").getFile());
String content = FileUtils.readFileToString(fi);
JSONObject JO= new JSONObject(content);
System.out.println("姓名是:"+JO.getString("name"));
}
}