user1938490
user1938490

Reputation: 11

Using a shell to run a bot in java

Hello I recently got a shell from http://shellmix.com/index.php/free-account/free-shell-account and I set it up and all. So then I put my bot (pircbot coded with Eclipse in Java) in Filezilla and http://pastebin.com/suJDwJfu is what I have done so far in putty. I just want it to host my bot and have it online always. My code runs fine in Eclipse so I put it in a .jar and changed the meta.inf to be working fine. And now I just need help running it. So please look at my errors and tell me what to do.

Edit: I fixed my manifest thing so now I get this error: http://pastebin.com/EuK5P6Lv

Upvotes: 1

Views: 321

Answers (2)

Danpe
Danpe

Reputation: 19047

Please make sure the following:

  1. You have a static main method:

    public static void main(String[] args) { //Your code to run }

  2. You have exported the jar using Eclipse->Export->Runnable Jar and chose the specific main function.

enter image description here

enter image description here

enter image description here

Upvotes: 1

asgoth
asgoth

Reputation: 35829

Your class must have public static void main(String args[]) method, which means you can execute the class from the commandline.

This does not make it the jar's main execution class, however. The main class is set in META-INF/MANIFEST.MF. Normally it should have a line:

Main-Class: classname

but then with the actual class.

So open the jar with a zip program, and check MANIFEST.MF.

Upvotes: 1

Related Questions