0

I am trying to upload a .jar file onto eclipse in order to be able to edit it.

The purpose of the .jar file is to track player coordinates on minecraft.

I have decompiled this .jar file on Eclipse, using the eclipse Java Decompiler.

However, when I try to run this decompiled code, I am getting the error: 'Could not find or load main class main'.

This happens when I try to run the 'decompiled code' by creating a run configuration and specify the main class: 'main'.

I have looked at other forums on this topic and have tried different things without success. However, none of these options have worked.

The decompiled 'main.class' file is currently stored within the 'JRE system library' folder. Is this the wrong place to store it?

I would be so grateful for a helping hand!

I have provided an image of the decompiled code:

enter image description here

And the run configuration tab, where I specify how I want the code to run.

enter image description here

Caledonian26
  • 727
  • 1
  • 10
  • 27
  • There is no main *method*. Also, please post code instead of images. – Andrew S Nov 22 '22 at 17:49
  • @AndrewS what method should I specify? :) – Caledonian26 Nov 22 '22 at 17:49
  • To me this looks like a Decompiled Bukkit plugin. They do not run on their own. – Lorenz Hetterich Nov 22 '22 at 17:51
  • It's not at all clear what you're trying to do. You tagged "minecraft", so you're probably trying to write a plugin, and those don't necessarily have a main class and intend to be running in the minecraft environment. – daniu Nov 22 '22 at 17:51
  • @LorenzHetterich how can I run this bukkit plugin? :) – Caledonian26 Nov 22 '22 at 17:51
  • 1
    To be clear, you want to run a minecraft bukkit server with the Plugin installed? I have never used bukkit for minecraft servers (I usually use Forge), but you can try to follow this guide: https://bukkit.fandom.com/wiki/Setting_up_a_server . However, I don't know wheter it is up-to-date and still works. – Lorenz Hetterich Nov 22 '22 at 17:55
  • @LorenzHetterich - why that should affect whether I am able to edit the code using a Java Decompiler on eclipse? :) – Caledonian26 Nov 22 '22 at 18:04
  • It doesn't but you can't run a plugin for an app on its own, which is what you're trying to do, and which obviously won't work. You need to run minecraft and tell it to include this plugin. Lorenz pointed you to a tutorial. – rzwitserloot Nov 22 '22 at 18:23
  • @rzwitserloot thank you for confirming - I will check out that link :) – Caledonian26 Nov 22 '22 at 18:24
  • I have posted a solution now :) – Caledonian26 Nov 22 '22 at 18:58

1 Answers1

0

I have now created a plugin using 'Maven', which allows me to edit the code given that to use Bukkit as an API requires the tool 'Maven'.

https://bukkit.fandom.com/wiki/Plugin_Tutorial_(Eclipse)#Example_Files_and_Templates

Thanks so much for the help :)

Caledonian26
  • 727
  • 1
  • 10
  • 27