System.out.println(Thread.currentThread().getContextClassLoader().getResource("").getPath());
获取的路径是:
workSpace/Project_name/Module_name/build/classes/main/
第一:设置project视图
第二:在src目录的main目录创建相应的文件夹resources和properties文件
运行main()后,会在 build 输出相应的文件夹
第三:读取properties文件,输出测试
摘要:Thread.currentThread().getContextClassLoader().getResourceAsStream("abc.properties") 获取输入