1

I have been trying for hours on how to get this file to executive. On Windows it starts up successfully but on Ubuntu it does not.

My guess is that I don't have permissions to run the file properly.

Basically I navigate the the folder the jar file is located in with the Terminal and type in

$ java -jar Bot.jar 

and I get an error saying

Error: Could not find or load main class net.minecraft.client.Main

Ive tried using sudo before the command and using chmod 755 but none of it is working.

Now like I said before this works fine on Windows and I can't seem to find what my issue is.

  • You most likely need to use the Minecraft Launcher to install a version of minecraft, which the bot will most likely use to interact with the Minecraft Servers. Have you installed a version of Minecraft? – earthmeLon Jun 17 '15 at 18:10
0

The error says that there is no main method in the jar file. Not all jar archives are supposed to be executed. Some are libraries, some don't come with a main method on another purpose.

An example of latter is the Minecraft client, which seems to be related to your question. It purposely doesn't have a main method as a rudimentary piracy protection. For it to start, it needs a launcher, which connects to the Mojang server, thereby starting a game session, which is then handed over to the client by calling some method in it.

So if your file - I'll ignore the naming - is a Minecraft client, you need the launcher to run it.

If it is the other way around, and your archive is a Minecraft launcher, you need to tell it where the Minecraft client is located (~/.minecraft/versions/<version>/<version>.jar), maybe by adding it to the PATH environment, maybe by giving it as an argument to the command.

If it is a Minecraft mod, you should have installation instructions along with it.

  • Well that doesnt answer the question on why it works in windows. I checked the file, it does have a main method. – Anon Ymous Jun 17 '15 at 16:33
  • Oh and it's a bot I found on a website. Not minecraft itself. a – Anon Ymous Jun 17 '15 at 16:39
  • Check whether the class is as main class in the manifest and the main method is public static void main(String[] args). – s3lph Jun 17 '15 at 21:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.