Creating a jar file?

Discussion in 'Spigot Plugin Development' started by shieken, May 23, 2015.

  1. Hi, so today i was trying to make a jar file from a plugin i decompiled. Well, unfortunately minecraft and jar files dont really like each other :/. So I was trying to figure out how I could successfully compile the plugin folder into a jar. The method I tried, which was making it a zip then changing the extension to jar didnt work. I also tried making the plugin an eclipse project, which didnt work either :/. Anyone know how to make a jar?



    P.S. I have a mac
  2. Hi Shieken.

    You've missed out an understanding of bytecode and the difference between compiletime and runtime.

    When editing files in your chosen IDE, or a text editor, they are .java files. These simply contain pure text and will not run.

    When you export, the JDK compiler converts these into a universal language called ByteCode and files with the .class extension.

    You should either learn how to use an IDE, or how to compile a Java class in the JDK command line.
    • Like Like x 1
  3. What do you mean minecraft and jar files dont like each other? o.0

    You have to recompile the decompiled code. Creating a project in eclipse and asking eclipse to export it for you is one option or you can recompile it from terminal.
  4. [​IMG]
    • Agree Agree x 2
  5. Are you referring to export a project into a .jar file?
  6. Ok here's the solution I came up with. I took the plugin, compiled it into a project on eclipse, then exported the project. I did the same with too many items mod and modded myself a client :D
  7. There was no other way to achieve this without compiling it, so I wouldn't even consider that a solution lol...

  8. If it works, it's a damn solution
    • Optimistic Optimistic x 1
    • Creative Creative x 1