It is very difficult to become a JAG officer if you start as a line officer (read, SA/ROTC/OTS/OCS graduate). This does not mean it's impossible; but, speaking from my experience in the USAF, only a handful of officers are selected to attend law school at the military expense every year. The program in the AF is called FLEP (funded legal education program), and you have to be at least a First Lieutenant to apply (I think, although senior 2LTs might be able to), so you generally need at least 2 years of active duty in another career field to even be considered.
Generally speaking, it is easier to already be a law student and/or have your JD/bar admission to get picked up as a JAG. Really, I don't believe any service academy allows for a direct entry into law school. Years ago, ROTC students could go to law school on an educational delay; however, it was at the expense of the student. I'm not even sure that is available now (although it might be).
I'm an attorney currently, and had considered applying for the FLEP while I was on active duty (was a missileer in the USAF). I decided that I'd rather be a civilian attorney; but, I did investigate the available military programs. I think, then, the "best" route (if there is such a thing) is to go to law school after undergraduate school and then apply for JAG as a 2L or 3L, if that is the only thing you want to do in the service. Some branches (Army) do offer loan forgiveness, and some will commission you as an O-1 while still a law student (there would be required summer training with a legal office near to your law school/home of record). From my research (which is a bit dated) the Navy (and maybe Air Force) get so much interest that they do not offer loan repayment (which, given law school tuition, can be substantial). Becoming a JAG is very competitive, as the legal market is saturated, and there are many qualified attorneys who are not accepted (thus, it is somewhat unlike the recruitment of dental/medical officers by the military). This isn't to dissuade you-just something to keep in mind.
Summation-ROTC/SA is not a particularly good route to become a JAG if that is the only thing that interests you. If you don't mind serving in another career field for a few years, it's not a bad way and is technically possible; BUT, it is still a long climb to get the service to pay for law school (they can get attorneys interested in entering the service without having to flip the bill).
This is what I've learned in my experience. Other opinions are welcome.