0

I am using sapjco3.jar in my project and it is working fine on Eclipse.

However, when I try to make it as an executable (I just right click on my Eclipse project and export it as a runnable jar, I only added the jar into the build path so that I can use its classes), it is not working. I managed to find that it throws an error:

It is not allowed to rename or repackage the original archive "sapjco3.jar"

Has anyone found any fix for this? All I find were regarding maven build but I do not know what to do when I'm just doing a simple runnable jar.

Does anyone know what to do?

NB: my Eclipse project doesn't have MANIFEST.MF.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Kawamoto Takeshi
  • 596
  • 1
  • 3
  • 24

1 Answers1

0

The simple answer is: Do not rename the original archive "sapjco3.jar". Keep the files in their original form like they are published by SAP.

I don't know what you are exactly doing when you say: "when I try to make it as an executable"?

Trixx
  • 1,796
  • 1
  • 15
  • 18
  • Hi @Trixx, I am not renaming the jar at all. What I mean by 'trying to make it as an executable' is making it into a runnable jar. – Kawamoto Takeshi May 28 '17 at 23:14
  • What is a runnable jar? Do you mean specifying some "Main-Class:" attribute in the jar's MANIFEST.MF? Then also add the "Class-Path: sapjco3.jar" attribute to the MANIFEST.MF. But the sapjco3.jar file must not be renamed and also must not be repackaged into your own jar file. You are doing at least one of both, otherwise you would not get this error message. – Trixx May 29 '17 at 16:25
  • Hi @Trixx, I just right click on my Eclipse project and export it as a runnable jar. My Eclipse project doesn't have MANIFEST.MF. I only added the jar into the build path so that I can use its classes. – Kawamoto Takeshi May 30 '17 at 03:51
  • So you are using the eclipse "Export Runnable JAR Wizard". I haven't used this yet and just tried it. What do you think are the build results of this wizard? Check it. The MANIFEST:MF is generated by the wizard. And what do you think are the wizard's different library handling options for? Test and read. There's also a help button. And please note: not everything what is in general possible in Java is also supported by JCo. And because JCo also requires native libraries, I don't think that you will become happy with this wizard. – Trixx May 30 '17 at 07:44