到这里下载
http://mvnrepository.com/
jar包!
将jar包放入项目目录中,并引入!
引入包到项目中!创建对象!
package com.company;
import redis.clients.jedis.Jedis;
public class Main {
public static void main(String[] args) {
// write your code here
Jedis jedis = new Jedis("192.168.1.66",6379);
jedis.auth("123456");
System.out.println(jedis.ping());
}
}
前提是开启了redis服务!