You can use a labeled break, which redirects the execution to after the block marked by the label:
OUTER:
while(x > 0) {
for(int i = 5; i > 0; i++) {
x = x-2;
if(x == 0)
break OUTER;
}
}
Although in that specific case, a simple break
would work because if x == 0
the while will exit too.