求救有关打包成jar的问题
我要将我的工程打成一个jar包,我的目录结构是这样的
com
--Application1.class
--Frame1.class
resource
--city.propertiy
在Frame1.class中我用file的方式调用了resource/city.propertiy文件,在jbuilder执行ok.
我把工程打包成jar,同时把resource加入到包里面,结果执行错误,说找不到resource/city.propertiy文件。为什么阿?
其实我知道如果用TestClass.class.getResource("resource/city.propertiy")能得到文件,但是我想把资源文件放在跟类包同一个目录。
怎么办?