Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i dont understeand #208

Open
JustNaka opened this issue Mar 27, 2022 · 4 comments
Open

i dont understeand #208

JustNaka opened this issue Mar 27, 2022 · 4 comments

Comments

@JustNaka
Copy link

i do this in main class in onenable

public static InventoryManager invManager;
invManager = new InventoryManager(this);
invManager.init();

this in gui class

public static final SmartInventory gui = SmartInventory.builder()
          .id("votesgui")
          .provider(new VoteGUI())
          .size(6, 9)
          .manager(MAINCLASS.invManager)
          .title(config.getString("votes_gui.title"))
          .closeable(false)
          .build();
 @Override         
 public void init(Player player, InventoryContents contents) {}   
 @Override
  public void update(Player player, InventoryContents contents) {}       
          

but give me this error

java.lang.NoClassDefFoundError: fr/minuskube/inv/content/InventoryProvider
        at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?]
        at java.lang.ClassLoader.defineClass(ClassLoader.java:1012) ~[?:?]
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:200) ~[pufferfish-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:587) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:110) ~[pufferfish-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:105) ~[pufferfish-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
        at com.justnaka.mcitavotes.MCITAvotes.registerEvents(MCITAvotes.java:79) ~[MCITAvotes-1.0.jar:?]
        at com.justnaka.mcitavotes.MCITAvotes.onEnable(MCITAvotes.java:45) ~[MCITAvotes-1.0.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[pufferfish-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[pufferfish-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[pufferfish-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugin(CraftServer.java:564) ~[pufferfish-1.18.1.jar:git-Pufferfish-38]
        at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugins(CraftServer.java:478) ~[pufferfish-1.18.1.jar:git-Pufferfish-38]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:729) ~[pufferfish-1.18.1.jar:git-Pufferfish-38]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:505) ~[pufferfish-1.18.1.jar:git-Pufferfish-38]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:315) ~[pufferfish-1.18.1.jar:git-Pufferfish-38]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1204) ~[pufferfish-1.18.1.jar:git-Pufferfish-38]
        at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:319) ~[pufferfish-1.18.1.jar:git-Pufferfish-38]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.ClassNotFoundException: fr.minuskube.inv.content.InventoryProvider
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:153) ~[pufferfish-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:105) ~[pufferfish-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
        ... 21 more

@ololjvNek
Copy link

ololjvNek commented Mar 27, 2022

Firstly read java docs.

java.lang.NoClassDefFoundError that exception says: Can't find classes loaded in/on plugin/server
so you just need to extract SmartInvs into your plugin

@JustNaka
Copy link
Author

in order not to import the SmartInvs plugin externally I imported the jar in the pom.xml in this way. what else should i do?

<dependency>
            <groupId>fr.minuskube.inv</groupId>
            <artifactId>smart-invs</artifactId>
            <version>1.2.7</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/jars/SmartInvs-1.2.7.jar</systemPath>
        </dependency>

@Leguan16
Copy link

have you already tried it with the plugin in the plugins folder of the server?

@lightPlugins
Copy link

lightPlugins commented Jul 19, 2022

If you use Intellij, go to Project Structure -> Artifacts -> Available Elements -> Right Click -> Extract Into Output Root

That will solve your problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants