Search code examples
javasapjco3

It is not allowed to rename or repackage the original archive “sapjco3.jar”?


I am trying to excute runnable jar file which is exported from eclipse wizard of my local project which have "sapjco3.jar" in build path. So, as soon as i try to execute jar file it gets following error: Illegal JCo archive "autobot.jar"(is my local jar file of my project). It is not allowed to rename or repackage the original archive "sapjco3.jar".

above problem occours while establishing java SAP connection(lib: "sapjco3.jar") at runtime.

Note: I am not Renaming or repackging Original sapjco3.jar


Solution

  • You can also create your own runnable jar, but then you have keep the sapjco3.jar file separate from your runnable jar and just include the 'sapjco3.jar' in its class path, e.g. specify in your MANIFEST.MF:

    Class-Path: <path>/sapjco3.jar
    

    If using the eclipse Runnable JAR File export wizard this is achieved by selecting the library handling option:

    • Copy required libraries into a sub-folder next to the generated JAR