Need help creating a JAR for my project

I'm having problems building a JAR file for my project. I go to Build>Build Jars and select my main class file and the module I want to include. After that my jar file is generated but when I run it, it only goes through the first part of the code (of the main method) and stops. Running it through IntelliJ, it works perfect. This is what my Main method looks like...

public static void main(String[] args) throws InterruptedException {
initLookAndFeel();
new Thread(new SplashWindow()).start();
Thread.sleep(3000);

if (!new File("password").exists()) {
AuthenticateUser authUser = new AuthenticateUser(0);
authUser.pack();
authUser.setVisible(true);
} else {
AuthenticateUser authUser = new AuthenticateUser(1);
authUser.pack();
authUser.setVisible(true);
}

if (!new File("config.xml").exists()) {
ConfigWizard dialog = new ConfigWizard(false);
dialog.pack();
dialog.setVisible(true);
}

//THIS IS WHERE EXECUTION SEEMS TO STOP

CentralizedSystem cs = new CentralizedSystem();
JFrame frame = new JFrame("CHS");
frame.setJMenuBar(menuBar);
frame.setContentPane(cs.panel1);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLocation(320,240);
frame.pack();
frame.setVisible(true);
}

The main method is in the CentralizedSystem class, which I instantiate just before the JFrame line. Could that be the problem?

Please sign in to leave a comment.