When I run native code:
File file = new File("lib", "jacob-1.17-M2-x86.dll"); //path to the jacob dll System.setProperty(LibraryLoader.JACOB_DLL_PATH, file.getAbsolutePath()); System.out.println("Done"); AutoItX x = new AutoItX(); System.out.println(System.getProperty("java.library.path")); x.run("notepad.exe");
Everything works OK, but when I try to execute this code as a part of Junit test (after @Test) I get:
java.lang.NoSuchFieldError: m_pDispatch at com.jacob.com.Dispatch.createInstanceNative(Native Method) at com.jacob.com.Dispatch.<init>(Dispatch.java:101) at com.jacob.activeX.ActiveXComponent.<init>(ActiveXComponent.java:58) at autoitx4java.AutoItX.<init>(AutoItX.java:181)




