I am using an LGPL library in my code. For my needs, I need to modify the code in the library.
How do I mark the jar file that it contains modified code? Some txt file in the jar? In that case, what do I write in the txt file?
I will include in the license agreement that we are distributing a modified version of the jar, but my question is about marking the jar itself.
The short answer: Avoid the issue
If you have fixed a bug, or added a feature why not submit it back to the original authors by way of a patch? If they accept it, the next version of the library will include your fixes and you won't need to worry about shipping a modified library! Sharing your changes/improvements to the library is the essence of the license, temporarily using a slightly modified version of the library while you are waiting for your submitted improvements is fairly common practice (see stuff about vendor branches). Becoming part of the development community means you are no longer shipping a 'modified' version of the library, but actively contributing your improvements to the original library for the common good.
The long answer: LGPL Version 3.0
From version 3.0 of the LGPL itself:
As long as you comply with the rest of the license text, you don't necessarily need to 'mark' the jar itself, with a text file or otherwise. For compilation reasons, you could follow the suggestion of extraneon and use a slightly different jar name. You could use a vendor branch or something to maintain the differences between your modifications and the original library. Here you are 'forking' the project, creating your own derivative work - the essence here is to share your changes and improvements to the source with the world.
The long answer: LGPL Version 2.1
From version 2.1 of the LGPL itself:
In essence you must say: Hey here is library 'foo', a modified version of library 'bar', here you can use my version of library 'foo' - it too is available under LGPL2.1. The prominent notices are also usually performed at the beginning of your modified source files in the LGPL license comment block. Again your are forking the library.