I already install JCo3 for linux.
I'm using ubuntu 16.04 x86_64 and java-8-oracle
As the documentation said, I need to add LD_LIBRARY_PATH and CLASSPATH to JCo directory.
export LD_LIBRARY_PATH=/home/zain/sapjco
export CLASSPATH=/home/zain/sapjco/sapjco3.jar
then create simple JCo connection test, but when I run my project I got error
error: package com.sap.conn.jco does not exist
Is there any particular step I missed?
Code:
import com.sap.conn.jco.*;
public class testjco {
public static void main(String[] args) {
JCO.Client mConnection;
try {
mConnection = JCO.createClient("301", // SAP client
"somecoolguy", // userid
"****", // password
"EN", // language
"XXX", // application server host name
"00"); // system number
mConnection.connect();
System.out.println(mConnection.getAttributes());
mConnection.disconnect();
} catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
}
}
}