My jar file runs but nothing comes up
<p>I have been searching the internet, but I can't find a solution for this. My program works fine in Eclipse, but I have to make the program into a <code>.jar</code> file so the user can just click on the <code>.jar</code> file and the GUI will run.</p>

<p>When I click on the <code>.jar</code> file that I exported, nothing happens. There is just the main class of the program and if I click run in Eclipse, the GUI will come up.</p>

<p>What do I need to add in here so the GUI will stay and not disappear straight away? I tried to put a <code>JOptionPane</code> in there and it works, the box will come out but the GUI will not still.</p>

<pre><code>package dijkstra;

import java.awt.BorderLayout;
import java.util.Map;
import javax.swing.JFrame;

public class RunGUI {
    public static void main(String[] args){
        FlightSchedulerGUI.setWindowsLookAndFeel();
        try {
            Map&lt;Integer, Airport&gt; airports = FileProcess.loadtegMap();
            FlightSchedulerGUI GUI = new FlightSchedulerGUI(airports);
            GUI.randomizeRoute();
            GUI.findBestRoute();

            JFrame frame = new JFrame();
            frame.setLayout(new BorderLayout());
            frame.add(GUI);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setTitle("Flight Scheduler");
            frame.setSize(600,400);
            frame.setVisible(true);



        } catch(Throwable t ){
            t.printStackTrace();
            System.err.flush();
            System.exit(1);
        }
    }

}
</code></pre>
