到這裏下載
http://mvnrepository.com/
jar包!redis
將jar包放入項目目錄中,並引入!3d
引入包到項目中!建立對象!code
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服務!對象