I need help with a problem and I'm just getting started with programming mincraft. As soon as I started I have this problem and I just can't find a solution. import org.bukkit.plugin.java.JavaPlugin;public class HalloWeltPlugin extends JavaPlugin { public void onEnable() { this.getLogger().info("Hallo Welt!");} public void onDisable() { } } then I get the following error message C:\Server\plugins\HalloWeltPlugin>javac HalloWeltPlugin.java -cp C:\Server\craftbukkit-1.18.1.jar HalloWeltPlugin.java:1: error: cannot find symbol import org.bukkit.plugin.java.JavaPlugin; ^ symbol: class JavaPlugin location: package org.bukkit.plugin.java HalloWeltPlugin.java:3: error: cannot find symbol public class HalloWeltPlugin extends JavaPlugin { ^ symbol: class JavaPlugin HalloWeltPlugin.java:5: error: cannot find symbol this.getLogger().info("Hallo Welt!"); ^ symbol: method getLogger() 3 errors
Yea, gotta say, that's one of the weirdest requests I've seen in awhile. Did someone prank you by telling you that you must do it manually? heh Code: public void onEnable() { this.getLogger().info("Hallo Welt!"); } The this keyboard is not necessary in this usage. It's used to refer to the current class, and invoking a class method of the class you are in doesn't require this. Another time it's handy is if you have a conflict of scope... like Code: class SomethingOrOther { private int widgets = 0; public SomethingOrOther(int widgets) { } } In that class, in the constructor, if you used widgets how does the system know if you mean the class widgets variable or the one passed? That's where this is useful, as you would set the class var to the method var via this.widgets = widgets; for example. Code: public void onDisable() { } There is no need to have empty methods in your class; if it has no code, there is no sense in having this.
I have a book that unfortunately describes it like this -.- i'm absolutely new to the whole topic. in the meantime i have dealt a little more with the idea. Now compile there and understand why you thought I was kidding you that was pretty stupid: D Unfortunately I still don't get the error fixed
@newUser How is python even involved My suggestion is to follow the compilation methods that your IDE uses. Which is Intelij from the looks of it in your case. Then your build path (the -cp) is handled by the IDE, compile errors show up in the code.
all right, I'll do it that way. In the meantime I have been able to achieve small successes by fixing the integration of bukkit, which was not yet in the project itself.