Error message 'no sapjcorfc in java.library.path'

Error message 'no sapjcorfc in java.library.path'

While compiling a piece of Java code making SAP connections, I get this error:

    Requires Free Membership to View

    When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSAP.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSAP.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

Exception in thread "main" java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middlew
are layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
no sapjcorfc in java.library.path
        at com.sap.mw.jco.JCO.(JCO.java:566)
        at test.main(test.java, Compiled Code)

Could you please let me know where the error lies?


This is likely caused by the fact that the Java compiler or interpreter cannot find the JCo application libraries in your system path. Depending on the operating system your are running, these are the non-Java link libraries that come with the JCo installation.

Look for 'sapjcorfc' in the JCo zipfile and copy this file into your system path (e.g. c:windowssystem32). This should fix your problem. If not, please email me your system details and I can better respond.


This was first published in November 2002