Exactly. It seems to me like justice is, at best, a strategy for optimizing happiness in a community of autonomous individuals who all have potentially competing needs. But the maximization of happiness is still, to me, the obvious goal and measure of any supposedly ethical system - including any supposedly ethical system of justice.
It's basically a tautology: What's the best ethical system? The one that maximizes whatever is good. What's good? Happiness (or pleasure, or whatever you want to call it).
That said, I think there are potentially different ways to calculate priorities for happiness accross a community. For instance, we could place a higher weight on alleviating suffering as opposed to maximizing pleasure (i.e. pleasure has diminishing returns above the x axis). I don't claim to know the "correct" way to calculate overall happiness. But I don't see how that in any way weakens the idea that maximizing happiness is the only reasonable goal of any ethical system.
Maybe there's a gap in my logic, but I really just don't understand why this isn't a settled issue in philosophy by now.