Java.lang.ClassNotFoundException what do I have to do to make it work?

Dr
- in Worlds
7

[17:56:01] [CanaryMod] [INFO]: Enabling Plugins…

[17:56:01] [CanaryMod] [ERROR]: Exception while enabling plugin: HelloWorld

net.canarymod.exceptions.PluginLoadFailedException: Failed to load plugin

at net.canarymod.plugin.lifecycle.JavaPluginLifecycle._load (JavaPluginLifecycle.java:36) ~ [CanaryMod.jar: 1.7.10-1.1.2]

at net.canarymod.plugin.lifecycle.PluginLifecycleBase.load (PluginLifecycleBase.java:71) ~ [CanaryMod.jar: 1.7.10-1.1.2]

at net.canarymod.plugin.lifecycle.JavaPluginLifecycle.load (JavaPluginLifecycle.java:16) ~ [CanaryMod.jar: 1.7.10-1.1.2]

at net.canarymod.plugin.PluginManager.enablePlugin (PluginManager.java:68) ~ [CanaryMod.jar: 1.7.10-1.1.2]

at net.canarymod.plugin.PluginManager.enableAllPlugins (PluginManager.java:101) [CanaryMod.jar: 1.7.10-1.1.2]

at net.canarymod.Canary.enablePlugins (Canary.java:284) [CanaryMod.jar: 1.7.10-1.1.2]

at net.minecraft.server.dedicated.DedicatedServer.e (DedicatedServer.java:278) [CanaryMod.jar: 1.7.10-1.1.2]

at net.minecraft.server.MinecraftServer.run (MinecraftServer.java:391) [CanaryMod.jar: 1.7.10-1.1.2]

at net.minecraft.server.MinecraftServer $ 3.run (MinecraftServer.java:742) [CanaryMod.jar: 1.7.10-1.1.2]

Caused by: java.lang.ClassNotFoundException: The class helloworld.HelloWorld could not be found!

at net.canarymod.CanaryClassLoader.findClass (CanaryClassLoader.java:55) ~ [CanaryMod.jar: 1.7.10-1.1.2]

at java.lang.ClassLoader.loadClass (Unknown Source) ~ [?: 1.8.0_241]

at java.lang.ClassLoader.loadClass (Unknown Source) ~ [?: 1.8.0_241]

at net.canarymod.plugin.lifecycle.JavaPluginLifecycle._load (JavaPluginLifecycle.java:27) ~ [CanaryMod.jar: 1.7.10-1.1.2]

… 8 more

Caused by: java.lang.ClassNotFoundException: helloworld.HelloWorld

at java.net.URLClassLoader.findClass (Unknown Source) ~ [?: 1.8.0_241]

at net.canarymod.CanaryClassLoader.findClass (CanaryClassLoader.java:37) ~ [CanaryMod.jar: 1.7.10-1.1.2]

at java.lang.ClassLoader.loadClass (Unknown Source) ~ [?: 1.8.0_241]

at java.lang.ClassLoader.loadClass (Unknown Source) ~ [?: 1.8.0_241]

at net.canarymod.plugin.lifecycle.JavaPluginLifecycle._load (JavaPluginLifecycle.java:27) ~ [CanaryMod.jar: 1.7.10-1.1.2]

… 8 more

This is what the shell says when I try to get the plugin to work, what can I do about it?

Fi

Difficult to answer without source code. He can't find helloworld.Helloworld because of the error. This could be wrong / missing imports, wrong path or something else.

Dr

And what do you have to do there's there a certain way that you can take that works? Or do you need other information to be able to say that?

Bu

The package name also serves as a location for the class. Is HelloWorld.java also in a helloworld folder?

The author of your book has placed his sample projects under http://media.pragprog.com/titles/ahmine2/code/ahmine2-code.zip. Does he also point out this address in his book?

Dr

Yes I downloaded the folder code and did everything as in the book, the file HelloWorld.java is in the folder anyway, it issues this error

Bu

Then unfortunately I can't help you directly. Perhaps you can write directly to the author or find programmers who have worked with CanaryMod somewhere else. In my opinion, it is a kind of configuration error that you have in front of you. The HelloWorld class can't be found and this is mostly due to the path from which it is searched.

Dr

Can I choose the path myself? So somehow indicate where the HelloWorld file is?

Bu

This is done by a configuration file (it is also in the folder). The class path (package + class name) is specified in it.