My small program runs fine in Eclipse but it won’t run after exporting and running as a jar file. Here is the exception it throws when run. (I might just need a link to a good article on exporting to a jar file). Thanks for helping.
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widge
ts/Layout
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Layout
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: EnterNames.EnterNames. Program will exit.
*******
Your program is making use of classes which are part of the Eclipse product. You need to either change your code to not use these classes, or identify the jars these classes are in and make sure that they are part of the classpath for your program. Then as @irrelephant says, you can setup a manifest or you can set them in a command line classpath parameter.