Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OSX 10.10 and Eclipse Luna. Own App crashes when started from inside Eclipse

I have updated to Yosemite today and have much problems with java. Most java applications crashes on start but after reinstall of the old Mac-Java 1.6 that problem seems to be solved.

But I have an other big problem. When I start Eclipse Luna and build my own Java application and start this application with the run button in Eclipse, it crashes with the following report:

dyld: lazy symbol binding failed: Symbol not found: _CGContextSetAllowsAcceleration
  Referenced from: /Library/Java/JavaVirtualMachines/1.6.0_35-b10-428.jdk/Contents/Libraries/libawt.jnilib
  Expected in: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices

dyld: Symbol not found: _CGContextSetAllowsAcceleration
  Referenced from: /Library/Java/JavaVirtualMachines/1.6.0_35-b10-428.jdk/Contents/Libraries/libawt.jnilib
  Expected in: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices

When I export the app as .jar file and start it from outside eclipse eveything works fine.

Do you have any solution how I can fix this? Otherwise I must reinstall Mavericks to be productive tomorrow.

like image 286
Thallius Avatar asked Oct 19 '14 12:10

Thallius


3 Answers

After I re-installed using http://support.apple.com/kb/DL1572 I had two JDK 1.6 versions in the system.

  1. /Library/Java/JavaVirtualMachines/1.6.0_65-b14-462.jdk/
  2. /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/ (1.6.0_65-b14-466.1)

1 (-462) was used by Eclipse. It gave the same error as you have.

2 (-466) was used from command line. That one worked.

So I changed the "Installed JREs" in the Eclipse preferences so it pointed to number 2 (-466). After that everything worked fine.

/Martin

like image 115
Martin Olausson Avatar answered Nov 15 '22 23:11

Martin Olausson


This fix worked for me:

Open your /Applications/{YOUR_IDEA}/Contents/Info.plist file and point to a newer java by changing

<key>JVMVersion</key>
<string>1.6*</string>

to

<key>JVMVersion</key>
<string>1.7+</string>
like image 38
cdeszaq Avatar answered Nov 15 '22 21:11

cdeszaq


I had the same issue. Reinstall java from http://support.apple.com/kb/DL1572

It worked for me after that.

like image 1
KunalC Avatar answered Nov 15 '22 21:11

KunalC