0

I'm working on a simple chatBot, just as a learning experience, and have hit a block. I have a rudimentery GUI setup that launches when I run the program with the command line, but not when I double-click the Jar. I am either missing code or exporting/running the program incorectly. Im using eclipse and exporting as a runnable jar. If anyone could point me towards a tutorial or some code that would be greatly appreciated.

Clarification... I want my chatBot to open a GUI when double-clicked, similar to the minecraft-server jar

EDIT I figured out what was wrong, it had nothing to do with the manifest or code... I was just executing a while loop wrong, I feel dumb now :(

Socratic Phoenix
  • 556
  • 1
  • 7
  • 19

2 Answers2

2

In order to make your jar 'runnable' in the command line, you need to specify which class is the main class to execute.

This is done by specifying a manifest.txt file that contains the following line:

Main-Class: the_package_and_name_of_your_main_class

How this manifest file is added to your jar depends on your build tool.

Jason
  • 11,744
  • 3
  • 42
  • 46
0

I second to Jason. Alternatively you may create one batch file (.bat) unless you want to make it work even on Linux (in this case you would .sh file).

Rahul Winner
  • 430
  • 3
  • 16