java - Could not load: InvalidPluginException -
i doing teleportation plugin. there fix this?
when loading on server, error:
[15:46:39 error]: not load 'plugins\rteleport.jar' in folder 'plugins' org.bukkit.plugin.invalidpluginexception: cannot find main class `me.roofer.rtel eport' @ org.bukkit.plugin.java.pluginclassloader.(pluginclassloader.jav a:42) ~[craftbukkit.jar:git-bukkit-1.7.9-r0.2-20-g0b2ed13-b3108jnks] @ org.bukkit.plugin.java.javapluginloader.loadplugin(javapluginloader.j ava:127) ~[craftbukkit.jar:git-bukkit-1.7.9-r0.2-20-g0b2ed13-b3108jnks] @ org.bukkit.plugin.simplepluginmanager.loadplugin(simplepluginmanager. java:328) ~[craftbukkit.jar:git-bukkit-1.7.9-r0.2-20-g0b2ed13-b3108jnks] @ org.bukkit.plugin.simplepluginmanager.loadplugins(simplepluginmanager .java:251) [craftbukkit.jar:git-bukkit-1.7.9-r0.2-20-g0b2ed13-b3108jnks] @ org.bukkit.craftbukkit.v1_7_r4.craftserver.loadplugins(craftserver.ja va:364) [craftbukkit.jar:git-bukkit-1.7.9-r0.2-20-g0b2ed13-b3108jnks] @ org.bukkit.craftbukkit.v1_7_r4.craftserver.(craftserver.java:32 6) [craftbukkit.jar:git-bukkit-1.7.9-r0.2-20-g0b2ed13-b3108jnks] @ net.minecraft.server.v1_7_r4.playerlist.(playerlist.java:68) [c raftbukkit.jar:git-bukkit-1.7.9-r0.2-20-g0b2ed13-b3108jnks] @ net.minecraft.server.v1_7_r4.dedicatedplayerlist.(sourcefile:14 ) [craftbukkit.jar:git-bukkit-1.7.9-r0.2-20-g0b2ed13-b3108jnks] @ net.minecraft.server.v1_7_r4.dedicatedserver.init(dedicatedserver.jav a:133) [craftbukkit.jar:git-bukkit-1.7.9-r0.2-20-g0b2ed13-b3108jnks] @ net.minecraft.server.v1_7_r4.minecraftserver.run(minecraftserver.java :436) [craftbukkit.jar:git-bukkit-1.7.9-r0.2-20-g0b2ed13-b3108jnks] @ net.minecraft.server.v1_7_r4.threadserverapplication.run(sourcefile:6 28) [craftbukkit.jar:git-bukkit-1.7.9-r0.2-20-g0b2ed13-b3108jnks] caused by: java.lang.classnotfoundexception: me.roofer.rteleport @ java.net.urlclassloader$1.run(unknown source) ~[?:1.8.0_25] @ java.net.urlclassloader$1.run(unknown source) ~[?:1.8.0_25] @ java.security.accesscontroller.doprivileged(native method) ~[?:1.8.0_ 25] @ java.net.urlclassloader.findclass(unknown source) ~[?:1.8.0_25] @ org.bukkit.plugin.java.pluginclassloader.findclass(pluginclassloader. java:77) ~[craftbukkit.jar:git-bukkit-1.7.9-r0.2-20-g0b2ed13-b3108jnks] @ org.bukkit.plugin.java.pluginclassloader.findclass(pluginclassloader. java:62) ~[craftbukkit.jar:git-bukkit-1.7.9-r0.2-20-g0b2ed13-b3108jnks] @ java.lang.classloader.loadclass(unknown source) ~[?:1.8.0_25] @ java.lang.classloader.loadclass(unknown source) ~[?:1.8.0_25] @ java.lang.class.forname0(native method) ~[?:1.8.0_25] @ java.lang.class.forname(unknown source) ~[?:1.8.0_25] @ org.bukkit.plugin.java.pluginclassloader.(pluginclassloader.jav a:40) ~[craftbukkit.jar:git-bukkit-1.7.9-r0.2-20-g0b2ed13-b3108jnks] ... 10 more
here code. there no warnings , config.yml
file fine.
package me.roofer.rteleport; import java.util.uuid; import java.util.logging.logger; import me.roofer.rteleport.rteleport; import org.bukkit; import org.bukkit.chatcolor; import org.bukkit.location; import org.bukkit.command.command; import org.bukkit.command.commandsender; import org.bukkit.entity.player; import org.bukkit.plugin.plugindescriptionfile; import org.bukkit.plugin.java.javaplugin; public class rtelport extends javaplugin { public logger logger = logger.getlogger("rtp"); public rteleport plugin; @override public void ondisable() { plugindescriptionfile pdffile = this.getdescription(); getlogger().info(pdffile.getname() + " has been disabled!"); } @override public void onenable() { plugindescriptionfile pdffile = this.getdescription(); getlogger().info(pdffile.getname() + " has been enabled!"); } public boolean oncommand(commandsender sender, command cmd, string commandlabel, string[] args){ player player = (player) sender; if(player.haspermission("rteleport.*")){ if(commandlabel.equalsignorecase("rtp")){ player.sendmessage(chatcolor.red + "not enough arguments!"); }else if(args.length == 1){ player targetplayer = player.getserver().getplayer(uuid.fromstring(args[0])); location location = targetplayer.getlocation(); player.teleport(location); player.sendmessage(chatcolor.dark_aqua + "teleportation commensing... "); } } return false; } }
set main:
key in plugin.yml
file full name of main class, including package.
main: me.roofer.rteleport.rteleport
i suggest follow naming conventions , put packages in lowercase.
Comments
Post a Comment