Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Lists

976 views
Skip to first unread message

Yarrmor

unread,
Aug 30, 2017, 11:16:34 AM8/30/17
to pircbotx
I'm getting the following error when I try to run it:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Lists
 at org
.pircbotx.Configuration$Builder.<init>(Configuration.java:318)
 at
Main.main(Main.java:14)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Lists
 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)
 
... 2 more

This is my current Main.java:

import org.pircbotx.Configuration;
import org.pircbotx.PircBotX;
import org.pircbotx.cap.EnableCapHandler;


public class Main {


   
public static final String BOTNAME = "BotName";
   
public static final String OAUTH = "OAUTH";
   
public static final String CHANNEL = "BotName";


   
public static PircBotX bot;


   
public static void main(String[] args) throws Exception {
       
Configuration config = new Configuration.Builder()
           
.setAutoNickChange(false) //Twitch doesn't support multiple users
           
.setOnJoinWhoEnabled(false) //Twitch doesn't support WHO command
           
.setCapEnabled(true)
           
.addCapHandler(new EnableCapHandler("twitch.tv/membership")) //Twitch by default doesn't send JOIN, PART, and NAMES unless you request it, see https://github.com/justintv/Twitch-API/blob/master/IRC.md#membership


           
.addServer("irc.twitch.tv")
           
.setName(BOTNAME) //Your twitch.tv username
           
.setServerPassword(OAUTH) //Your oauth password from http://twitchapps.com/tmi
           
.addAutoJoinChannel("#"+CHANNEL)
           
.buildConfiguration(); //Some twitch channel


           
//.addListener(new MyListener())
       
        bot
= new PircBotX(config);
        bot
.startBot();
   
}
}

I did change the 3 static strings in my code. But, idk how to resolve the error message. I followed the docs.

darkgob

unread,
Aug 30, 2017, 1:52:30 PM8/30/17
to pirc...@googlegroups.com
Is Google Guava in your classpath?  It seems like you're missing a dependency.  It doesn't seem to be documented anywhere except the v2.0 Migration Guide (unless I'm missing something), but these are the libraries you need to include in order for PircBotX to work: https://github.com/TheLQ/pircbotx/wiki/MigrationGuide2#why-did-this-change-3

--
You received this message because you are subscribed to the Google Groups "pircbotx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pircbotx+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages