I was addicted to a simple test of Jedis (Java-> Redis library)

At one point I wanted to write a simple program that connects Java to Redis, tutorialspoint https://www.tutorialspoint.com/redis/redis_java.htm I was addicted to it when I saw it and tried it exactly, so I made a memorandum.

As introduced, the flow of downloading the Jedi jar from the repository, passing it through the classpath, writing a Java sample application, importing the Jedi and connecting it to Redis is the same, but the DL of jedis.jar is From here, if you use jedis-2.1.0-sources.jar obtained from the link, you will get the following error when using the Jedi class.

Exception in thread "main" java.lang.NoClassDefFoundError: redis/clients/jedis/Jedis
        at RedisJava.main(RedisJava.java:6)
Caused by: java.lang.ClassNotFoundException: redis.clients.jedis.Jedis
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 1 more

I wondered if the class itself was wrong (details unknown) If you go back in the path of the download URL http://repo1.maven.org/maven2/redis/clients/jedis/ I can download a newer version of jedis.jar, so I tried using 3.0.0 and it ran fine (connecting to Redis from the java sample app). This is the DL I did http://repo1.maven.org/maven2/redis/clients/jedis/3.0.0/jedis-3.0.0.jar

Connection to server sucessfully
Server is running: PONG
}}}


Recommended Posts

I was addicted to a simple test of Jedis (Java-> Redis library)
I was addicted to the Spring-Batch test
[CircleCI] I was addicted to the automatic test of CircleCI (rails + mysql) [Memo]
I was addicted to the record of the associated model
GetXxxx of ResultSet was addicted to primitive type (Java)
The part I was addicted to in "Introduction to Ajax in Java Web Applications" of NetBeans
A memorandum because I was addicted to the setting of the Android project of IntelliJ IDEA
What I was addicted to when introducing the JNI library
A story I was addicted to in Rails validation settings
I was addicted to the setting of laradock + VSCode + xdebug
I tried to make a client of RESAS-API in Java
A story I was addicted to with implicit type conversion of ActiveRecord during unit testing
A note when I was addicted to converting Ubuntu on WSL1 to WSL2
I was addicted to the API version min23 setting of registerTorchCallback
Java Artery-Easy to use unit test library
I want to write a unit test!
I was addicted to rewriting to @SpringApplicationConfiguration-> @SpringBootTest
I was addicted to the roll method
A memo that was soberly addicted to the request of multipart / form-data
A story I was addicted to when testing the API using MockMVC
Recorded because I was addicted to the standard input of the Scanner class
I was a little addicted to running old Ruby environment and old Rails
I was a little addicted to ssh connection from mac to linux (ubuntu)
A story that I was addicted to twice with the automatic startup setting of Tomcat 8 on CentOS 8
I made a primality test program in Java
I was addicted to using RXTX on Sierra
A story addicted to EntityNotFoundException of getOne of JpaRepository
Summary of points I was worried about when migrating from java to kotlin
I did Java to make (a == 1 && a == 2 && a == 3) always true
I wanted to make (a == 1 && a == 2 && a == 3) true in Java
I wrote a primality test program in Java
I was addicted to installing Ruby/Tk on MacOS
I was addicted to doing onActivityResult () with DialogFragment
I was a little addicted to the S3 Checksum comparison, so I made a note.
A collection of simple questions for Java beginners
SpringSecurity I was addicted to trying to log in with a hashed password (solved)
I tried to break a block with java (1)
What I was addicted to when developing a Spring Boot application with VS Code
When I tried to unit test with IntelliJ, I was told "java.lang.OutOfMemoryError: Java heap space"
A story I was addicted to when getting a key that was automatically tried on MyBatis
I was addicted to the NoSuchMethodError in Cloud Endpoints
I made a simple calculation problem game in Java
I want to call a method of another class
I tried to decorate the simple calendar a little
I tried to create a Clova skill in Java
Awesome Java: A number of great Java framework library software
Let's make a robot! "A simple demo of Java AWT Robot"
I tried to make a login function in Java
kintone clone? I was quite addicted to launching OSS WebDB Extension with Lightsail + Docker, so make a note of it.
How to batch initialize arrays in Java that I didn't know when I was a beginner
A story I was addicted to before building a Ruby and Rails environment using Ubuntu (20.04.1 LTS)
I tried to modernize a Java EE application with OpenShift.
[Java] I want to convert a byte array to a hexadecimal number
What I fixed when updating to Spring Boot 1.5.12 ・ What I was addicted to
I tried to summarize the basics of kotlin and java
What I was addicted to while using rspec on rails
[Beginner] Try to make a simple RPG game with Java ①
I was addicted to setting default_url_options with Rails devise introduction
[Beginner] I made a program to sell cakes in Java
I was addicted to looping the Update statement on MyBatis
I want to make a specific model of ActiveRecord ReadOnly