gpt4 book ai didi

java - 将 jar 添加到不适用于 redis 的库

转载 作者:行者123 更新时间:2023-11-30 07:14:29 25 4
gpt4 key购买 nike

我正在尝试将 redis 包添加到 Java 中。我对 java 非常陌生,正在使用 netbeans IDE 学习本教程

Tutorial that I am following http://www.tutorialspoint.com/redis/redis_java.htm

但是当我尝试构建时出现以下错误

error: package redis.clients.jedis does not exist
import redis.clients.jedis.Jedis;

这里有一些屏幕截图,显示我已添加该包

enter image description here

enter image description here

enter image description here

最佳答案

*-sources.jar 文件不包含编译代码,它们包含源代码,用于调试(大部分)。为了使您的代码正常工作,您需要将正确的 jar 添加到构建路径,在本例中为 jedis-2.1.0.jar。您可以从here下载.

关于java - 将 jar 添加到不适用于 redis 的库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38679371/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com