Hutool名稱的由來
Hutool = Hu + tool,是原公司項目底層代碼剝離后的開源庫,“Hu”是公司名稱的表示,tool表示工具。Hutool諧音“糊塗”,一方面簡潔易懂,一方面寓意“難得糊塗”。
開發中需要引入的jar
Maven
在項目的pom.xml的dependencies中加入以下內容:
<dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-all</artifactId> <version>5.6.1</version> </dependency>
Gradle
compile 'cn.hutool:hutool-all:5.6.1'
public static void main(String[] args) {
//resources文件下面的配置文件
ClassPathResource resource = new ClassPathResource("application-dev.properties");
Properties properties = new Properties();
try {
properties.load(resource.getStream());
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(properties.get("url"));
}