Reputation: 9846
I look over a lot of info on the web also look at some of the questions here, but couldn't solve my problem so I post this question. I have fairly simple project using SWING
which compiles and run under Eclipse, but when I try to use the standard Export->Java->Runnable Jar
leaving the default properties at the end I have a file which when I dobule-click I get this: Could not find the main class: TableFilterDemo. Program will exit
.
Here is my project structure:
And this is the configuration I use for creating the Runnable Jar
:
And because as far as I understand the error there is some problem with locating the main
method I left TableFilterDremo.java
with only the main
method in it:
public class TableFilterDemo{
public static void main(String[] args) {
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
CreateGUI.createAndShowGUI();
}
});
}
}
By far no success.
Upvotes: 2
Views: 2832
Reputation: 3876
On the screen before the one you show in the screenshoot, you have to manually select the classes that will be included in the jar.
A good way to check they have been included is to unzip the generated jar file (for example with winzip or winrar) and check it contains all the files.
Upvotes: 0
Reputation: 53871
If you go through the full wizard that Eclipse provides, you'll see there is a screen prompting you to select a main class.
Upvotes: 1