Integrate licence in Eclipse java

First of all, thank you for your attention!
I have the following problem – I have to read a text from a image, which works fine.
Within Eclipse, I can also use the programme perfectly.
I use 2 libraries: Tesseract (tess4j) and opencv-451.

But when I export the programme to a runnable jar, I get this error message. Error Message Image

If I export the jar anyway, it does not work because the libraries are missing (surprise).

But these should be usable with the APACHE LICENSE, VERSION 2.0.
I have added the copyright notice to every class I created, as in image 2, and I would also like the creators of the libraries to get their deserved mention.

Unfortunately I don’t know what I did wrong or what I have to do differently to be able to use these libraries as an export jar, because this is the first time I do something with free licenses.

Can someone tell me where the error is and how I can make Eclipse pack the required file into the exported jar, or what I can do alternatively?

Thank you for your help!


You have misunderstood two separate issues here.

  1. That is not an error. That is a warning. It is informing you that you are probably violating the terms of the license of at least one of the libraries you are trying to include if you do not take appropriate steps. Eclipse cannot verify that you did take these steps – therefore, taking these steps does not make the warning go away. However, it is a warning – when you click okay, eclipse carries on, and does precisely what you asked it to do. It includes those libraries as normal; it has warned you about the need to confirm that you either conform to the license agreement of these libraries, or live in a jurisdiction where you are not bound by the terms of these licenses or they are not actionable (and you are morally okay with ignoring them) – the rest is up to you.

  2. The way to adhere to these licenses is certainly not to include an additional copyright header. Instead…

    1. For most FOSS licenses, you must make a reasonable effort informing the user of your product that you have these libraries included. If it’s a GUI app, naming them in the ‘about’ box is a good place to credit them. If it’s not, well, do not take legal advice from a Stack Overflow answer, but, make sure it is made clear in the ‘user focussed’ part of whatever website a user might download these from, during the process of getting the download, that you use these libraries. If it is software you only run on machines under your own control (such as a web server based concept), it gets more nebulous; that is a giant can of worms (does the GPL imply that if you build a web stack on top of a GPLed library, that you must distribute the source code of it and give appropriate credits?) – GPLv3 has been written to try to close that loophole but nothing of significance has been tested, as far as I know, in either european or american courts.

    2. Furthermore, most FOSS licenses that are restrictive like this also require that you also open source your product. You do not have to ship sources along with the distributable binary, but that is one easy way to fulfill the license requirements. You can also just post them on your site, or e.g. host your source repository on a publicly accessible site such as github. Again, I’m not your lawyer.

However, as I said – eclipse is not going to check if you have hosted the project on github and included an about dialog. It merely pops up that warning. That’s why the warning has a ‘stop telling me next time’ checkbox.

So, what’s going wrong?

Nothing related to licensing, that’s for sure. You can check that the jar file that eclipse produced contains what you need, by opening the jar file with any tool capable of reading zip files, such as 7zip, or on a posixy command line, unzip -l, or use the jar tool using jar tvf thefile.jar which lists the contents. You are NOT looking for tess4j.jar in your jar file – you are looking for the contents of tess4j.jar. If you see it, eclipse included it. If your app does not work properly, check how these are included. Do they have the right path? How did you set up your eclipse project to include these dependencies? Make screenshots of your project config (right click the project, pick ‘properties’, and the tabs that talk about build path are relevant), or if it’s a maven or gradle project, post your pom.xml or build.gradle files, and probably in a new question, as this one has now best locked in as a misguided question about licensing.

Leave a Reply

Your email address will not be published. Required fields are marked *