Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 358523

Summary: Following the Hello World SWT tutorial gives me a runtime error: "Could not load SWT library"
Product: [Eclipse Project] Platform Reporter: khleyerkhe
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: major    
Priority: P3 CC: daniel_megert, lshanmug, nick
Version: 3.8   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
Contains screenshots of my setup. none

Description khleyerkhe CLA 2011-09-22 03:27:30 EDT
Build Identifier: I20110613-1736

I have tried twice to follow the instructions for the Hello World SWT tutorial.  Both times I tried to run the application but got this failure:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
	no swt-cocoa-3735 in java.library.path
	no swt-cocoa in java.library.path
	Can't load library: /Users/kasemset/.swt/lib/macosx/x86_64/libswt-cocoa-3735.jnilib
	Can't load library: /Users/kasemset/.swt/lib/macosx/x86_64/libswt-cocoa.jnilib

	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:285)
	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:194)
	at org.eclipse.swt.internal.C.<clinit>(C.java:21)
	at org.eclipse.swt.widgets.Display.<clinit>(Display.java:101)
	at HelloWorldSWT.main(HelloWorldSWT.java:12)

I have also attempted to find help online for this, but the only thing I found was this page (in German) which required a complicated workaround:
http://www.macuser.de/forum/f25/bringe-swt-eclipse-592430/

I have also attempted with a "-d64" VM flag as suggested in
http://www.eclipse.org/swt/faq.php#cocoa64launch

I will attach screenshots of my setup.

Reproducible: Always

Steps to Reproduce:
1. Download Eclipse Classic 64-bit for Mac.
2. On the Welcome screen choose the Hello World SWT Tutorial.
3. Follow the instructions exactly.

When I repeated this, I just deleted everything from my workspace and started over.
Comment 1 khleyerkhe CLA 2011-09-22 03:28:25 EDT
Created attachment 203818 [details]
Contains screenshots of my setup.
Comment 2 Dani Megert CLA 2011-09-22 03:59:05 EDT
Are you sure that you have a 64-bit JRE installed?
Comment 3 khleyerkhe CLA 2011-09-22 11:05:43 EDT
(In reply to comment #2)
> Are you sure that you have a 64-bit JRE installed?

Is this right?  I just installed whatever Eclipse had me install when I first launched it (I didn't have Java installed then, so I said OK to some dialog and it ran Software Update for me).

Macintosh-50 ~  $ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-383, mixed mode)
Comment 4 Lakshmi P Shanmugam CLA 2019-03-07 00:03:27 EST
This works for me with Eclipse 4.10. Please reopen if you still see the problem.