在Eclipse和IntelliJ中運行UISpec測試用例時,我收到了上述錯誤消息(java.lang.UnsatisfiedLinkError)。運行uispec4j測試用例時的java.lang.UnsatisfiedLinkError
我安裝了sun/oracle JDK 1.7。
錯誤的報告全文
> Exception in thread "main" java.lang.UnsatisfiedLinkError: > sun.awt.motif.MToolkit.init(Ljava/lang/String;)V at > sun.awt.motif.MToolkit.init(Native Method) at > sun.awt.motif.MToolkit.<init>(MToolkit.java:146) at > sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) > at java.lang.reflect.Constructor.newInstance(Constructor.java:525) > at java.lang.Class.newInstance0(Class.java:372) at > java.lang.Class.newInstance(Class.java:325) at > org.uispec4j.interception.toolkit.UISpecToolkit.buildUnderlyingToolkit(UISpecToolkit.java:128) > at > org.uispec4j.interception.toolkit.UISpecToolkit.setUp(UISpecToolkit.java:39) > at > org.uispec4j.interception.toolkit.UISpecToolkit.<init>(UISpecToolkit.java:24) > at org.uispec4j.UISpec4J.initToolkit(UISpec4J.java:39) at > org.uispec4j.UISpec4J.init(UISpec4J.java:31) at > org.uispec4j.UISpecTestCase.<clinit>(UISpecTestCase.java:31) at > sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) > at java.lang.reflect.Constructor.newInstance(Constructor.java:525) > at junit.framework.TestSuite.createTest(TestSuite.java:131) at > junit.framework.TestSuite.addTestMethod(TestSuite.java:114) at > junit.framework.TestSuite.<init>(TestSuite.java:75) at > com.intellij.junit3.TestRunnerUtil.createClassOrMethodSuite(TestRunnerUtil.java:140) > at > com.intellij.junit3.TestRunnerUtil.getTestSuite(TestRunnerUtil.java:79) > at > com.intellij.junit3.JUnit3IdeaTestRunner.startRunnerWithArgs(JUnit3IdeaTestRunner.java:50) > at > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) > at > com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:601) at > com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) > > Process finished with exit code 1
如果有人經歷過同樣的問題,請幫助我。
謝謝老兄。我會看看。 – Athiruban 2011-12-30 11:19:05
你確實是對的。問題是由於JDK 1.7中的工具包不可用。但是當我運行> javap sun.awt.Motif.MToolkit時,它顯示了類聲明。所以我認爲這個類在JDK1.7中可用。另外,我向UISpec開發團隊報告了這個問題。再一次,非常感謝。 – Athiruban 2011-12-30 12:43:01