Showing results for 
Search instead for 
Did you mean:

Former Member
0 Kudos


i am trying to connect my system to Sap system through java class...

in my class i used the following statements...


public class Connect1 extends Object {

JCO.Client mConnection;

it is giving errors as

"the import be resolved"

"JCO cannot be resolved to a type"

does the java lib comes with or we have install these ones separately...

thank you,


Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You have to install JCO on your local machine, or obtain the java library sapjco.jar and add it to your classpath.

If you use SAP developer studio, this library comes with it.

Former Member
0 Kudos

hello liu,

could u pls tell where i can find this sapjco.jar library...from sap site is asking username and passwd...

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Ajay,

Nice hear that you got the JCo. Please award point for those replies that helped you.

Please check the below link for details



Former Member
0 Kudos

thx balakrishnana and liu,

i have got sapjco jar file...

cheers aj.

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Ajay,

You can download the SAP Java Connector from <b> -> SAP Java Connector</b>. You should have a login at Service Market Place.

Once downloaded copy the sapjco.jar into <b><JAVA_HOME>\jre\lib\ext</b> folder and copy the <b>librfc32.dll</b> and <b>sapjcorfc.dll</b> into the C:\WINNT\system32 folder (or appropiate folder where you have the OS).

That's it and you will be able to run JCo programs.

Thanks & Regards,


Former Member
0 Kudos

Hi Kathirvel,

I am migrating my application from Jboss to SAP WAS 6.40. We were using SAP r/3 adaptors in JBoss, where we were deploying a sap.rar file comprising of the sapjar file.

Do i ned to do a similar thing in SAP WAS or is it al integrated into the Netweaver Application Server? Also do i still need the dll files on my path?

Also in SAP WAS, do i need to deploy the adaptor, if yes where can i configure it.

any help is much appreciated.



Former Member
0 Kudos

Hi Dushy,

You can follow the following steps while integrating ur application to Netweaver Application Server (NAS) -

Note - Only EAR files can be deplyed in NAS. So build it if you dont have

Add these files to the build path:





They can be found under the plugins\lib\ and\lib\.

Open your project in Netweaver and do following configurations -

Goto Windows -> Preferences -> On the the right side tree menu click on SAP j2EE Engine

On left side of the screen put the IP Address and Port number of SAP server

Now you will have to Make a SAP connector Using this Engine, by following the steps given :-

Click on File -> New -> Other -> Choose SAP connectivity

Give the name of package in which you want to generate the Proxy Classes which will connect to SAP BAPIs

Give the name of the class file which will contain the information of BAPI

Click on Finish

You need the following code to connect to SAP server -

JCO.Client jcoclient =










You need to create an instance of the generated proxy class, supply the proxy instance with a JCo connection, and get the output from the function module

Add the following code:

MyProxy_PortType myproxy = new MyProxy_PortType();


Choose Save.

You will see that you need to handle exceptions if any.

After all execution disconnect the connection by using - jcoclient.disconnect();

Build Your Application EAR and right Click on it to Deploy on the Server This will ask for SDM password. Your application is now deplyed now you have to run the application.

Running Appliaction -

Click on Run -> Run - > Click on J2EE configuration option and Click New

Under Web Objects Tab -> Give your EAR file and welcome file

Under J2EE engine Tab give Click on Select for choosing the instance of J2EE Engine which you have configured previously

GIve the Host Name and Port Number of SAP server

Click on Apply and Run