本文介绍了OSX 10.10和Eclipse Luna。自己的应用程序从Eclipse内部启动时崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天已经更新到优胜美地,并且对java有很多问题。大多数Java应用程序在启动时崩溃,但重新安装旧的Mac-Java 1.6后,该问题似乎得到解决。

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.

但是我还有一个大问题。当我启动Eclipse Luna并构建我自己的Java应用程序并使用Eclipse中的运行按钮启动此应用程序时,它会以以下报告崩溃:

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

当我将应用导出为.jar文件并从外面启动eclipse eveything工作正常。

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.

推荐答案

在我使用我在系统中有两个JDK 1.6版本。

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)被Eclipse使用。它给出了与您相同的错误。

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

2(-466)是从命令行使用的。那个工作。

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

所以我改变了Eclipse首选项中的已安装的JRE,所以它指向数字2(-466)。之后,一切顺利。

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

/ Martin

这篇关于OSX 10.10和Eclipse Luna。自己的应用程序从Eclipse内部启动时崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 18:01