pom文件
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.8.1</version>
</dependency>
public static void main(String[] args){
Jedis jedis = new Jedis("192.168.1.153", 6379);
//jedis.auth("123456");
//调用jedis对象的方法,方法名称和redis 的命令一致
jedis.set("key2", "jedis test2");
String string = jedis.get("key2");
System.out.println(string);
}