How to run SWT application created in Eclipse from command line

528 Views Asked by At

I created my SWT project in Eclipse and the software helps me in dealing with all the library stuff. As far I a see, the project has a JRE(1.8) library and a reference library which contains all the libraries needed for my code.

My code works well in Eclipse, but when I export the project into a jar file and run it by "java -jar myCode" the error appeared -

"Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Composite......"

My understanding is that when I tried to run the program without Eclipse, I did not specify the reference libraries so it will not tell classes in the reference libraries. I'm using Mac and not sure how to specify the reference for my program.

Can anyone give a step by step example to show the processes? Thanks in advance.

0

There are 0 best solutions below