Well, a just war is, in essence, a form of self-defense. I would say that if one country is facing a proven and concrete threat something that endangers its security and the lives of its people then that country has the right to defend itself, and in such a case, that defense may involve war.
However, it must always be ensured that the consequences of the war do not cause greater harm than the situation would have without going to war. So it must be very carefully measured. Conflicts must not be unnecessarily prolonged or escalated. Everything must be calculated and considered very cautiously.
This principle aligns with natural law and even with basic common sense. War is always a form of evil and must be avoided because it stands against peace it is contrary to love of neighbor. It is not the commandment of God that we fight one another. Christianity is about love above all, promoting peace and mutual respect.
Only in extreme situations when peace and security cannot be guaranteed by any other means can war be considered, and even then, only as a last resort.