我用的是 redis git上的例子。下了jar包之后直接写了个测试类,不好使。
Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused
public class Test {
public static void main(String[] args) {
Jedis jedis = new Jedis("localhost");
jedis.set("hello", "hi");
String value = jedis.get("hello");
System.out.println(value);
}
}