What happens if you commit with
git commit -a
?
Otherwise, try adding the files one by one with
git add src/yourfilepathandnamehere.java
If all else fails, try starting over again: delete the remote repository, delete the .git folder, make sure the .gitignore is up to date, and only then
git init
.
Good luck! And please tell us if/what helped, or what further error messages you're getting!