package com.yq1012.config; import java.util.ResourceBundle; public class TestResourceBundle { private static String COM_REPORT_PATH;// 获取路径 static { ResourceBundle rb = ResourceBundle.getBundle("config/config"); COM_REPORT_PATH = rb.getString("COM_TENDER_PATH"); } public static void main(String[] args) { System.out.println(COM_REPORT_PATH); } }
config.properties
COM_TENDER_PATH=www.javaweb.top
路径如下图