What is the fix for class file for com.google.common.base.predicate not found?

The sselenium program that I have been developing for a while now appears com.google.common.base.Predicate not found when I open it in Netbeans. It seems that some Java update has removed or changed this library. Do I need to reinstall it or is there some kind of replacement?

+6
source share
2 answers

This class is part of the Guava library. This should be on your way to the class. But when updating Java, libraries do not magically disappear from the project path class. Someone had to remove it.

+8
source

This class is usually found in a jar file called google-*.jar . Try to find it on your file system, and if you do, make sure the CLASSPATH environment variable is pointed at it (the variable should point to the jar file, not the directory that contains it). If you did not find it in your file system, you need to download it (for free) and then provide the correct CLASSPATH . Alternatively, you can use the system package management tool to download it, in which case there is a chance that it will automatically update CLASSPATH (you may need to log out and again or restart the shell, etc., to make the last change effective )

If you want to validate the jar file that you find / load contains a class, you can do something like this (Unix / Linux):

 jar -tf file.jar | grep 'com.google.common.base.Predicate' 

where you must substitute the name of the file you found / downloaded for file.jar.

+1
source

Source: https://habr.com/ru/post/900678/


All Articles