"Launch Configuration" Shows up Blank When Trying to Export Runnable Jar?

I've gotten this to work in the past, but now whenever I choose File > Export... > Runnable JAR File and select the drop-down menu "Launch Configuration", all I get is a blank bar.

How can I get my main class to show up?


Launch configurations are presumably used because they describe the main class you want to run, and the libraries the main class needs. They are created automatically when you run your main class inside Eclipse.

In the Package Explorer panel, right-click on the class you want to have main(...) executed in and choose Run as -> Java Application to run your program.

This process creates a launch configuration you can use (and save too, if you make it shared)

right-click, run as->java application


I came across this same issue today as I have many times in the past, and although I've usually corrected it as Thorbjorn has posted, for some reason it was not working for me today.

Typically I would just browse to the project, search for the main class, and hit apply then run, but it wasn't working. Still wouldn't show main class while trying to export runnable jar.

I actually had to go run configurations, and right click on the window to the left under Java Application and click 'new'. It then created a new configuration item where I could browse to the project, and add the main class. Then it would show up while trying to export runnable jar.

enter image description here


This "launch configuration" thingie is all fine and good, but you probably just want to specify a main class. One of the pages of the "export" dialog will let you browse for and specify that main class, without the need to go looking for an appropriate configuration. That's how I do it.


EDIT

What I do is

File | Export | Java | Jar File

Then I select the stuff I want exported.

Next | Next and I get a chance to specify my main file.