linux下测联sap,报错:java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path
环境变量如下设置:
CLASSPATH=.:/opt/java6/lib/tools.jar:/opt/java6/lib/dt.jar:/opt/java6/jre/lib/rt.jar:/opt/java6/lib/sapjco3.jar
LD_LIBRARY_PATH=.:/usr/lib:/lib:/opt/java6/jre/lib/IA64N/server/
出现错误:
[web]TOPFeConsole:/orauser/web/sapTest>javac CustomDestinationDataProvider.java
[web]TOPFeConsole:/orauser/web/sapTest>java CustomDestinationDataProvider
java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
at com.sap.conn.jco.rt.DefaultJCoRuntime.loadLibrary(DefaultJCoRuntime.java:443)
at com.sap.conn.jco.rt.DefaultJCoRuntime.registerNativeMethods(DefaultJCoRuntime.java:309)
at com.sap.conn.jco.rt.JCoRuntime.registerNatives(JCoRuntime.java:1030)
at com.sap.conn.rfc.driver.CpicDriver.<clinit>(CpicDriver.java:956)
at com.sap.conn.rfc.engine.DefaultRfcRuntime.getVersion(DefaultRfcRuntime.java:43)
at com.sap.conn.rfc.api.RfcApi.RfcGetVersion(RfcApi.java:261)
at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:200)
at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:74)
at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)
at com.sap.conn.jco.rt.RuntimeEnvironment.<init>(RuntimeEnvironment.java:42)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:359)
at java.lang.Class.newInstance(Class.java:312)
at com.sap.conn.jco.ext.Environment.getInstance(Environment.java:125)
at com.sap.conn.jco.ext.Environment.registerDestinationDataProvider(Environment.java:220)
at CustomDestinationDataProvider.main(CustomDestinationDataProvider.java:67)
Exception in thread "main" java.lang.ExceptionInInitializerError: Error getting the version of the native layer: java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path
at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:212)
at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:74)
at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)
at com.sap.conn.jco.rt.RuntimeEnvironment.<init>(RuntimeEnvironment.java:42)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:359)
at java.lang.Class.newInstance(Class.java:312)
at com.sap.conn.jco.ext.Environment.getInstance(Environment.java:125)
at com.sap.conn.jco.ext.Environment.registerDestinationDataProvider(Environment.java:220)
at CustomDestinationDataProvider.main(CustomDestinationDataProvider.java:67)