Your code is missing a "loop" label. I'm going to guess that it should go above the first "add".
You should be using the "u" form of addition and subtraction instructions. That is, "addu" instead of "add", and "addiu" instead of "addi". This is because "add" and "addi" will crash on overflow instead of wrap. Java does not crash on integer overflow, and you wanted the MIPS equivalent of the Java code.
Instead of literally "str1" and "str2", the MIPS code should have the names of the registers into which the user-specified numbers were loaded.
"move $reg1, $reg2" is equivalent to "addu $reg1, $zero, $reg2". In fact, the "move" instruction does not actually exist, and is actually implemented as macro for "addu" with register $zero by the assembler.
Also, are you using an assembler that automatically handles reordering? I'm curious whether your assembler handles the MIPS delay slot for you, or whether you need to put stuff in the delay slot of branches yourself. This can change how you need to code your loop.