Hi everyone I am trying to create runnable jar file using Eclipse I am using two external libraries the first one is SWT library and the second one is opencv the application is working great in eclipse but once I try to export the jar file I received warnings:
and I get the following errors once I tried to run the jar file using the terminals by this command:
java -jar <name>.jar
I received the following errors:
***WARNING: Display must be created on main thread due to Cocoa restrictions.
org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:4491)
at org.eclipse.swt.SWT.error(SWT.java:4406)
at org.eclipse.swt.SWT.error(SWT.java:4377)
at org.eclipse.swt.widgets.Display.error(Display.java:1097)
at org.eclipse.swt.widgets.Display.createDisplay(Display.java:848)
at org.eclipse.swt.widgets.Display.create(Display.java:831)
at org.eclipse.swt.graphics.Device.<init>(Device.java:130)
at org.eclipse.swt.widgets.Display.<init>(Display.java:721)
at org.eclipse.swt.widgets.Display.<init>(Display.java:712)
at org.eclipse.swt.widgets.Display.getDefault(Display.java:1427)
at detectingApplication.gui_rec.<init>(gui_rec.java:42)
at detectingApplication.gui_rec.main(gui_rec.java:58)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Any suggestions?