To include only a set of files with tar, you can use the following one liner. This example will tar all files with the java extension in the archive with the name test.
find . -name '*.java' | tar czvf test.tar.gz --files-from -
Java-ML
PHP-agenda
AJT
EasyJSON
EPSGraphics