Plugin Error Help

Discussion in 'Plugin Development' started by Trill, Jan 6, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Trill

    I made a plugin that lists the ranks on a server but when I tested it, it gave an error and didn't start up.
    Error Message:

    06.01 20:23:13 [Server] INFO org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: me/CubedOutGaming/Ranks/Ranks : Unsupported major.minor version 52.0 06.01 20:23:13 [Server] ERROR Could not load 'plugins/Ranks.jar' in folder 'plugins'

    I'm not so sure what it means. Any help for what I should do?
     
  2. Offline

    ColonelHedgehog

    It sounds like you're trying to run a Java 1.8 plugin on a system that only supports 1.7.

    Or vice-versa, I'm not sure. I do know that the error means you're using a plugin that isn't supported on your language level.
     
  3. Offline

    Trill

    How can I switch it to make it work? I had no issues with the plugin I made a bit ago.
     
  4. Offline

    xTigerRebornx

    @Trill Either update your server to Java 8 or compile w/ Java 7
     
  5. Offline

    Trill

    I found how to compile with Java 7 but I am am not using a Maven Project so I can't find pom.xml to switch to Java 7. I am using a JavaProject instead.
     
    Last edited: Jan 7, 2015
  6. Offline

    mythbusterma

    @Trill

    Then switch whatever you're using to compile to compile with Java 7.
     
  7. Offline

    Burnett

    @Trill In eclipse you can right click your project and click "Build path". Go to the libraries tab and click the java library it is using then select edit and change it to the desired version.
     
  8. Offline

    Trill

    @mythbusterma
    I found a button what allows me to convert to Maven Project. Should I do it?
     
  9. Offline

    mythbusterma

    @Trill

    If you want a Maven project.
     
  10. Offline

    Trill

    @mythbusterma
    Could it ruin my plugin? Also what would it change?
     
  11. Offline

    mythbusterma

    @Trill

    If you don't understand what Maven is and why it's used, you probably shouldn't be using it. Just change your compile version. It really is not difficult.
     
  12. Offline

    Burnett

    @Trill D̶o̶ ̶y̶o̶u̶ ̶k̶n̶o̶w̶ ̶w̶h̶a̶t̶ ̶m̶a̶v̶e̶n̶ ̶i̶s̶?̶ ̶I̶f̶ ̶n̶o̶t̶ ̶t̶h̶e̶n̶ ̶e̶i̶t̶h̶e̶r̶ ̶g̶o̶o̶g̶l̶e̶ ̶i̶t̶ ̶a̶n̶d̶ ̶f̶i̶n̶d̶ ̶o̶u̶t̶ ̶o̶r̶ ̶d̶o̶ ̶w̶h̶a̶t̶ ̶I̶ ̶s̶t̶a̶t̶e̶d̶.̶ Ninja'd
     
  13. Offline

    Trill

    I'm trying to find how to change my compile version but none of the websites are helping.
     
  14. Offline

    mythbusterma

    @Trill

    In most IDE's it's a project setting....
     
  15. Offline

    Trill

    @mythbusterma

    I FOUND IT

    My server is running on Java 1.8 and my plugin is using 1.7...
     
  16. Offline

    mythbusterma

    @Trill

    That wouldn't cause an error. Your server is running 1.7 and you're compiling against 1.8.
     
  17. Offline

    Trill

  18. Offline

    mythbusterma

  19. Offline

    Trill

    @mythbusterma

    That picture shows how it was set already. I didn't change anything.
    Switching it to 1.8 gives errors everywhere...
    What should I do?

    Now the plugin shows up in the list of plugins but everytime that I type the command to use the plugin, it gives: http://gyazo.com/f90b5e7bc2b9336bb4c4cd47fd603091

    The Console shows:
    07.01 09:57:17 [Server] ERROR Cannot load configuration from jar
    07.01 09:57:17 [Server] INFO Enabling Ranks v1.0

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
  20. Offline

    sirrus86

    The image you showed would tell me that an error stacktrace probably showed up in the console. We'd need to see that and some of your source, particularly the class where the command is fired.
     
  21. Offline

    Trill

    When I type the command in chat:
    07.01 10:19:54 [Server] INFO ... 13 more 07.01 10:19:54 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit-beta.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks] 07.01 10:19:54 [Server] INFO at me.CubedOutGaming.Ranks.Ranks.onCommand(Ranks.java:32) ~[?:?] 07.01 10:19:54 [Server] INFO Caused by: java.lang.NullPointerException 07.01 10:19:54 [Server] INFO at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [craftbukkit-beta.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks] 07.01 10:19:54 [Server] INFO at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:469) [craftbukkit-beta.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks] 07.01 10:19:54 [Server] INFO at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:558) [craftbukkit-beta.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks] 07.01 10:19:54 [Server] INFO at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:260) [craftbukkit-beta.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks] 07.01 10:19:54 [Server] INFO at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:667) [craftbukkit-beta.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks] 07.01 10:19:54 [Server] INFO at net.minecraft.server.v1_7_R3.ServerConnection.c(SourceFile:134) [craftbukkit-beta.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks] 07.01 10:19:54 [Server] INFO at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:157) [craftbukkit-beta.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks] 07.01 10:19:54 [Server] INFO at net.minecraft.server.v1_7_R3.PacketPlayInChat.handle(PacketPlayInChat.java:47) [craftbukkit-beta.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks] 07.01 10:19:54 [Server] INFO at net.minecraft.server.v1_7_R3.PacketPlayInChat.a(PacketPlayInChat.java:28) [craftbukkit-beta.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks] 07.01 10:19:54 [Server] INFO at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java:817) [craftbukkit-beta.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks] 07.01 10:19:54 [Server] INFO at net.minecraft.server.v1_7_R3.PlayerConnection.handleCommand(PlayerConnection.java:956) [craftbukkit-beta.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks] 07.01 10:19:54 [Server] INFO at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServer.java:701) ~[craftbukkit-beta.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks] 07.01 10:19:54 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) ~[craftbukkit-beta.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks] 07.01 10:19:54 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit-beta.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks] 07.01 10:19:54 [Server] INFO org.bukkit.command.CommandException: Unhandled exception executing command 'ranks' in plugin Ranks v1.0 07.01 10:19:54 [Server] ERROR null
     
    Last edited: Jan 12, 2015
  22. Maybe this help you :
    Code:
    public void sendMessage(Player player, String path) {
       if(getConfig().getString(path) == null { return; } 
       String string = getConfig().getString(path);
       player.sendMessage(ChatColor.translateAlternateColorCodes('&', string));
    }
    
    //How to use it :
    sendMessage(player , "X");
     
  23. Offline

    Trill

    I fixed the error on my own.
     
  24. Offline

    ColonelHedgehog

    Mind telling us how you did it? It might help anyone with a similar problem who reads this thread.
     
  25. Offline

    Trill

    I don't think that this is the best solution to it but I erased the config and made everything by sending text to a player using the regular Eclipse color tools e.g (ChatColor.AQUA)
     
Thread Status:
Not open for further replies.

Share This Page