-1

When I've tried to open a jar file in terminal (OS X 64 bit), I got the next message :

What should I do in order to open the file?

software1 bktomer$ java -jar MusicTunes.jar

***WARNING: Display must be created on main thread due to Cocoa restrictions.

Exception in thread "main" org.eclipse.swt.SWTException: Invalid thread access

at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.widgets.Display.error(Unknown Source) at org.eclipse.swt.widgets.Display.createDisplay(Unknown Source) at org.eclipse.swt.widgets.Display.create(Unknown Source) at org.eclipse.swt.graphics.Device.<init>(Unknown Source) at org.eclipse.swt.widgets.Display.<init>(Unknown Source) at org.eclipse.swt.widgets.Display.<init>(Unknown Source) at org.eclipse.swt.widgets.Display.getDefault(Unknown Source) at il.ac.tau.cs.sw1.musictunes.ui.GraphicalMusicTunesViewer.createShell(GraphicalMusicTunesViewer.java:63) at il.ac.tau.cs.sw1.musictunes.ui.GraphicalMusicTunesViewer.show(GraphicalMusicTunesViewer.java:55) at il.ac.tau.cs.sw1.musictunes.ui.GraphicalMusicTunesViewer.showViewer(GraphicalMusicTunesViewer.java:38) at il.ac.tau.cs.sw1.musictunes.ui.GraphicalMusicTunesViewer.main(GraphicalMusicTunesViewer.java:33) 
0

1 Answer 1

1

You must specify the -XstartOnFirstThread option when running an SWT program on OS X:

java -XstartOnFirstThread -jar MusicTunes.jar 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.