Hiroshima was only necessary if it was the only way to get Japan to capitulate. This ignores rumours of back-channel diplomatic dealing that could have seen through a less humiliating exit for Japan.
It certainly does not fall under the precepts for a "just war".