On linux there is a tool called "linecount", on a debian you can just write "apt get linecount" to install it. It can count your Java code for you and even calculate manhours based on the COCOMO method (A very silly method but fun nontheless).

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org