I'm working on a commercial Java product that is distributed as a .war file. I want to add the source code of a class I found in a book to our code base. The book gives no license information for the included code (and also not in the companion Github repository). I've been in touch with the author of the book and he wrote me that I can use the code however I like as long as I retain his copyright.

Now adding a copyright note as a comment to the class' source code is straightforward, but seems not enough for a product that will be shipped in binary.

I've read that adding a line to our own license file that goes with the .war file, saying "Part of this product includes code from ..." would be enough, and it is not necessary to precisely specify what code is used where.

Is this correct? Can anybody tell me the correct way to make such a copyright reference?

  • Well, it sounds to me like the permission he gave you informally "to use the code in any way you like" counts as permission to use the code in a shipped binary for commercial purposes. As to how you can precisely interpret the requirement to fulfill the obligation to "retain his copyright" in the binary; I'm not sure that's something we can answer. For a well-known license like MIT and Apache, you would get answers that the community can agree on. But for an informal e-mail exchance or statement like this, it's up to interpretation. If in doubt you could e-mail him/her back and ask again.
    – Brandin
    Jul 4, 2023 at 14:52
  • @Brandin Thanks for your comment. I was under the impression that there might be an already established way to make such a copyright reference. I'm afraid the author wouldn't want to be bothered with such practical issues. I'll wait a bit longer to see if anybody else has a suggestion.
    – ThomasH
    Jul 4, 2023 at 15:49
  • "The book gives no license information for the included code" - I think it should be pointed out somewhere, that most likely this means the code is not open source. Even if the author gave you permission to use it -- suppose you put that code into a product and decide to publish your code later with a license such as Apache or MIT. Well, legally you can't do that now, since the author only gave "you" permission to use it, not necessarily for anyone else downstream to do so. This is one reason why standard, well-understood licenses are preferred.
    – Brandin
    Jul 6, 2023 at 7:28

1 Answer 1


There is usually a copyright notice at the beginning of the book. Check it out and you can write it like this:

Some of the code contained in this software is from the book [title] by [author]. [all copyright notices here].

You can use your "Part of this product includes code from" text too.

Make sure that the author of the book can give you such permission. Sometimes the copyrights are transferred to the publisher instead of staying with the author.

This is not legal advice

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.