//使用Spring的工具就行了1 import java.util.Properties; 2 import org.springframework.core.io.support.PropertiesLoaderUtils; 3 4 Properties prop = PropertiesLoaderUtils.loadAllProperties("XXX.properties"); 5 prop.getProperty("name");