操作系统为Windows 7 64bit Enterprise,JDK版本为32bit的"1.5.0_22"。按照sapjco2的说明已经把sapjcorfc.dll和librfc32.dll复制到目录c:\system\windows\
system32,可是仍然得到错误:
Exception in thread "main" java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [no sapjcorfc in java.library.path]. java.library.path [C:\Program Files (x86)\Java\jdk1.5.0_22\bin;.;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Java\jdk1.5.0_22\bin; C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ThinkPad\Bluetooth Software\;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;C:\Program Files (x86)\Windows Live\Shared;c:\cygwin\bin;C:\Users\dingjun.jia\Documents\Data\UnxUtils\usr\local\wbin;C:\Users\dingjun.jia\Documents\Data\projects\o2 SAP\cmd;]
at com.sap.mw.jco.JCO.<clinit>(JCO.java:820)
at JM_I025B.countVendorData(JM_I025B.java:26)
at JM_I025B.main(JM_I025B.java:10)
很明显是找不到sapjcorfc.dll,所以不能加载。把sapjcorfc.dll和librfc32.dll这两个文件复制到jdk的bin目录下,也就是上面错误中的第一个目录中,就能正确加载了。难道java只在目录列表中的第一个目录去寻找。
没有评论:
发表评论