Java 找不到属性文件

Java 找不到属性文件,java,spring,Java,Spring,我有许多Java属性文件,这些文件过去被包含在标准的参考资料目录中,Spring的以下属性持有者可以正常工作 <context:property-placeholder location="classpath:/project/myproperty.properties/> 并且属性文件确实存在于以下目录下: C:\Deployment\config\project\myproperty.properties 有人能告诉我我做错了什么吗?你可以这样做: <context:p

我有许多Java属性文件,这些文件过去被包含在标准的
参考资料
目录中,Spring的以下属性持有者可以正常工作

<context:property-placeholder location="classpath:/project/myproperty.properties/>
并且属性文件确实存在于以下目录下:

C:\Deployment\config\project\myproperty.properties

有人能告诉我我做错了什么吗?

你可以这样做:

<context:property-placeholder location="file:${my.config.location}\project\myproperty.properties"/>

希望这有帮助。

试试
classpath://myprpoerty.properties
。顺便说一句,它应该拼写为myproperty.谢谢。那是个打字错误。我纠正了它。
<context:property-placeholder location="file:${my.config.location}\project\myproperty.properties"/>
java -Dmy.config.location="C:\Deployment\config" ...